Automated trading platform

ABSTRACT

Embodiments of the present invention include forecasting methods and systems and methods and systems for responding to forecasts. In one embodiment of the present invention, financial market trends are automatically forecast, allowing for automatic generation of specific market-transaction recommendations. An automated trading program embodiment of the present invention includes a short-term price forecaster and a controller that makes transaction recommendations.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the benefit of Provisional Application No.60/630,822, filed Nov. 23, 2004.

COMPUTER PROGRAM LISTING APPENDIX

Two identical CDs identified as “Disk 1 of 2” and “Disk 2 of 2,”containing program source code implementing an embodiment of the presentinvention, are included as a computer program listing Appendix B. Theprogram text can be viewed on a personal computer running a MicrosoftWindows operating system, using Microsoft Notepad or other utilitiesused for viewing ASCII files.

TECHNICAL FIELD

The present invention is related to forecasting, and, in particular, forforecasting financial market trends.

SUMMARY OF THE INVENTION

Embodiments of the present invention include forecasting methods andsystems and methods and systems for responding to forecasts. In oneembodiment of the present invention, financial market trends areautomatically forecast, allowing for automatic generation of specificmarket-transaction recommendations. An automated trading programembodiment of the present invention includes a short-term priceforecaster and a controller that makes transaction recommendations.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows an architectural overview of the Automated TradingPlateform according to one embodiment of the present invention.

FIG. 2 shows a dynamic Price Trajectory according to one embodiment ofthe present invention.

FIG. 3 shows forecast engine internals according to one embodiment ofthe present invention.

FIG. 4 shows composition of a short-term price according to oneembodiment of the present invention.

FIG. 5 shows an architecture for a continuous forecast engine accordingto one embodiment of the present invention.

FIG. 6 shows parallel operation of a parameter adaptation engine and acontinuous forecast engine according to one embodiment of the presentinvention.

FIG. 7 illustrates sliding-window forecasting according to oneembodiment of the present invention.

DETAILED DESCRIPTION OF THE INVENTION

Introduction

The Automated Trading Platform that represents one embodiment of thepresent invention implements a programmable financial forecasting andinvesting system designed to achieve pre-specified objectives for profitand risk by trading equities in a given portfolio. The platform isimplemented through an architecture. A block diagram depicting the maincomponents of this architecture and their connectivities is shown inFIG. 1.

The architecture of the trading platform is composed of two components,a Short-Term Price Forecaster 102 and a Controller 104, as illustratedin FIG. 1. The Short-Term Price Forecaster generates a time series ofpredicted security prices and their associated risk. Once securityprices and risk are created the Controller develops recommendations fortrading actions. These recommendations are reviewed and may beoverridden by the user in forming buy and sell orders for the financialasset market. An implementation of one embodiment of the presentinvention is presented in this document.

Most problems involving the generation of actions in the financialenvironment are characterized by non-stationary uncertainty,non-negligible risk, and noisy, incomplete information. Embodiments ofthe present invention are based on the observation that financialdecisions and forecasting processes are dynamical systems which can onlybe characterized, with acceptable level of accuracy, by fusing andsynchronizing multiple models. Fusing and synchronizing models in thiscontext means combining the extraction capabilities of specializedalgorithms to produce an output with a lower level of uncertainty andbetter performance compared to results one would obtain by usingindividual models.

The basis of embodiments of the present invention is to modeluncertainty using differential geometry. The concept starts with astochastic differential equation and solves a piecewise diffusionequation with impulses. Unlike the Black-Scholes formula, we are notlimited to the linear Gaussian case. Our internal model is based on ageneral predictor-corrector algorithm derived from the appropriateChapman Kolmogorov propagation model 6.

Model Overview

Our system is based on a model for the dynamics of the portfolio, whichis a piecewise diffusion process (PDP) [6]. We consider the price andrisk of n stocks. We let the stochastic process x(t) be an n×1 vectorfor the price trajectory and u(t) be an m×1 vector for volumetrajectory. In general, the dimensions of x(t) and u(t) are not thesame. For instance, x(t) might be an 2n×1 vector for price and pricerate trajectory and u(t) might be an n×1 vector for volume trajectory.However, one implementation treats m=n. We refer to x(t) as a pricetrajectory, and u(t) as a volume trajectory.

In one embodiment of the present invention, the Automated TradingPlatform forecasts the price trajectory in the Short-Term PriceForecaster, and controls the volume trajectory in the Controller, basedon the stochastic model in (1). The form of this model is bilinear inprice x(t) and volume u(t), which reflects their interdependence andlack of causality. This stochastic model is the foundation of theShort-Term Price Forecaster and the Controller. In the Controller, welet the volume trajectory be impulses at times τ_(k) and characterizethe stochastic process x(t) with the following PDP${\mathbb{d}{x(t)}} = {{\left( {A_{0} + {\sum\limits_{j = 1}^{p}{D_{j}{f_{j}(t)}}}} \right){x(t)}{\mathbb{d}t}} + {{{Cf}(t)}{\mathbb{d}t}} + {{\phi(t)}{\mathbb{d}t}} + {{\mathbb{d}\omega}\quad(t)}}$for  τ_(k)⁺ ≤ t ≤ τ_(k + 1)⁻ and${x\left( \tau_{k}^{+} \right)} = {{x\left( \tau_{k}^{-} \right)} + {\left( {\sum\limits_{i = 1}^{m}{A_{i}{u_{i}\left( \tau_{k} \right)}}} \right){x\left( \tau_{k}^{-} \right)}} + {{Bu}\left( \tau_{k} \right)}}$for an interval tε[t₀,t₁], with impulses at times τ_(k). The i^(th)element of u(t) associated with stock i is denoted u_(i)(t). We assumethat the impulse times τ_(k) are known, but in the future we may allowthe impulse times to be Markov times. In our model 1, the volumeu(τ_(k)) is an impulse control, and the price is not well-defined atτ_(k), so we use the notation x(τ_(k) ⁻) and x(τ_(k) ⁺) to jump over theimpulse time. A sample realization of a one-dimensional process x(t)with three impulses of volume is illustrated in FIG. 2.

The financial model given in (1) provides the ability to forecast andrecommend trading decisions at the speed needed for an automated tradingplatform. The bilinear model with impulses in (1) mathematicallyaccounts for jumps in the price x(t). The price jumps (as illustrated inFIG. 2) are not necessarily due to drastic changes in the market, butmay be due to shifts in the frequencies, or spectral content, of thesignals. The piecewise diffusion model in (1) does not assume that themarket is a diffusion model, but rigorously models the discontinuitiesas impulses.

Empirical examination of market data supports the PDP model. Performinga Fast Fourier Transform (FFT) of the signal generates the underlyingfrequencies. The spectral analysis reveals discrete frequencies whichsupport the PDP model with a diffusive component as well as adeterministic component. If the market were a pure diffusion process,the spectral analysis would generate a continuous spectrum offrequencies. This frequency analysis explains why the market does notbehave as a Gaussian model—because it has discontinuities.

The difference between a PDP model as opposed to a Black-Scholesdiffusion model is magnified when considering a real-time system with asampling interval of 0.1 milliseconds. Consider the current system whichis using 30 seconds between data updates. In the current system, a bidor ask order by one of the specialists of approximately one millionshares will impact the market, and in 30 seconds, the price of the stockwill reflect this large order. However a smaller order of one hundredshares in 30 seconds will have a negligible effect on the market. Nowconsider the future system with 0.1 milliseconds between data updates.In the future system, a bid or ask order of one hundred shares willimpact the market (because the system is 10,000 times faster, so10ˆ6/10ˆ4 would have a similar impact). The model that represents anembodiment of the present invention can appropriately account for theseimpulses, whereas a Black-Scholes model will artificially createvolatility because of the incorrect assumption of a diffusion process.

Another consequence of the PDP model is the opportunity to takeadvantage of frequencies associated with a stock price. If we canpredict the dominant frequency, then we not only recommend what totrade, but more importantly when to trade. For example, the model mayrecommend holding one stock for twice as long as another stock based ontheir frequency analyses. This implies that we should first predict thedominant frequency and then forecast the phase to utilize our model atanother level.

The stochastic process ω(t), which drives the price variation x(t),represents uncertainty in our model, and is assumed to be aSemi-Martingale (6). This stochastic process ω(t) represents theinherent uncertainty due to the market environment and the accuracy ofthe model. We let φ(t) be an n×1 vector, representing the average valueof the perturbation introduced by the market. The stochastic processω(t) has zero mean, is of bounded quadratic variation, and has an n×ncovariance matrix function Q(t). We assume that ω(t) is uncorrelatedwith x(t), i.e. E[x(t)ω(τ)]=0 for τ<t.

The piece-wise constant parameters of the model are A₀, A_(i), i=1, . .. ,m, D_(j), j=1, . . . ,p, B, and C. The n×n matrix A₀ defines a salesrate (also known as elasticity parameter in Leontief's model). The A₀matrix is also called the relaxation matrix. The diagonal terms of A₀establish the price trend of each stock, and the off-diagonal termsestablish the relative advantage of one stock over another. The A_(i)matrices are the effect of volume on price rate, and are n×n matriceswhich are multiplied by the i^(th) element of u(t), for I=1, . . . ,m.The A_(i) matrices are called structure matrix coefficients becausetheir product A_(i)u_(i)(t) modifies the price model. The rank of eachmatrix A_(i) is one, and to simplify, we assume that the ii^(th) entryis the only nonzero entry. The term A_(i)u_(i)(t) captures the effect ofthe price rate due to demand, if u_(i)(t) is positive for stock i, thenthe price acceleration increases, and vice versa.

The D_(j) matrices, for j=1, . . . ,p, are diagonal n×n matrices thatcharacterize the effect of the market on rate price. For each aggregatemarket signal f_(j)(t), the product D_(j)f_(j)(t) represents thedynamics of the coordinate system of the market. This allows us to workin a principal coordinate system. The matrix B is an n×m diagonal matrixcalled the demand coefficient matrix, and C is an n×p coefficient matrixthat measures the effect of the aggregate market on price rate. We use{circumflex over (p)}(t) to denote the collection of parameters (A₀,A_(i), i=1, . . . ,m, D_(j), j=1, . . . ,p, B, and C) of the model, withtheir current values at time t, as described in Section 3.5.

The characteristics of the market environment (for example, S&P500, DowJones, etc.) are included in f(t), a p×1 vector, and f_(j)(t) is thej^(th) element of f(t).

We manage the uncertainty due to parameter values and the uncertaintydue to the market environment separately by employing two engines thatinteract (see Meditch [5], 1968 for a discussion on forced separation).In the Short-Term Price Forecaster, the Parameter Adaptation Engineaddresses the uncertainty in the parameters, and the Continuous ForecastEngine captures the remaining uncertainty. We use the concept of asliding window to continuously adapt and coordinate changes to price,volume, and parameters over short periods of time. The length of thesliding window is chosen so that the parameters are constant withrespect to the model (1).

Real-time market and financial asset data are fed into the Short-TermPrice Forecaster. The Short-Term Price Forecaster includes ask pricex^(ask), bid price x^(bid), sell price x^(sell), and volume u^(data),for each stock, as well as market characteristics f^(data). We use{Z(t_(k))} to denote the data observations that are collected at timeinstances t_(k) that are not necessarily equally spaced. This data isfiltered in the Asynchronous Filter Bank, and used to calculatecontinuous input series Z(t), which consists of the individual inputseries.

Short-Term Price Forecaster

Introduction

The Short-Term Price Forecaster is a real-time application forgenerating short-term forecast signals of price, risk, volume, andvolatility for a user-selected portfolio. The input data is of twotypes: market data and asset data. The market data consists ofuser-selected indices (for example, DJIA, NASDAQ). In addition, theShort-Term Price Forecaster is supplied with asset data for each of theassets in the user's selected portfolio. The Short-Term Price Forecasteroperates in sliding window mode and executes the repair strategy.

The concept of the repair strategy that is described here can adapt overshort time periods when the price changes. The model is based on apropagator of the first moment conditioned on the filtration defined bythe market data, and the second conditional moment that measures thevolatility of the market. The model continuously repairs itself, as thesystem learns more accurate values of the model parameters. This repairstrategy is crucial for periods of high volatility. The repair strategybegins by training the model with historical data to estimate theparameters. The dynamical model and the estimated parameters can then beused to solve for the price and risk trajectories. The time windowadvances and the data is updated. Then the parameters are estimated forthe new time window. With each advance of the time window, the repairstrategy continuously solves for the price and risk trajectories whileupdating the parameters in real-time.

The core of the Short-Term Price Forecaster is the Forecast Engine,which consists of three basic components: the Continuous Forecast Enginethat estimates price and risk, the Parameter Adaptation Engine thatestimates model parameters, and the Asynchronous Filter Bank thatfilters observations and produces continuous input streams. Theuncertainty in the model is due to two reasons: uncertainty due tomarket environment and accuracy of the model, and uncertainty due to theparameter values. By using a separation principle, we can account forthe two types of uncertainties separately in two coupled models. Thesecoupled models can be executed in parallel with information exchange.The Parameter Adaptation Engine addresses the uncertainty due toparameter values and the Continuous Forecast Engine addresses theuncertainty due to market environment and accuracy. The sliding windowconcept with real-time data provides synchronization of the models,achieving our goal of predicting price and risk with a known level ofuncertainty.

The overall system architecture of the Forecast Engine is shown in FIG.3. The architecture consists of seven components: Continuous ForecastEngine (CFE), Parameter Adaptation Engine (PAE), Asynchronous FilterBank (AFB), Learning Engine, Shared Memory System, Window Clock andSynchronization.

The Continuous Forecast Engine generates the nominal price {tilde over(x)}^(N)(t) and risk {tilde over (Θ)}^(N)(t) trajectories using a repairstrategy while the Parameter Adaptation Engine updates the parameters{circumflex over (p)}(t) of the model. These parameters are stored inthe Shared Memory System where, along with the computed input series andreal-time data, they are available for the Continuous Forecast Engine toaccess at any moment. The Asynchronous Filter Bank filters the real-timedata {Z(t_(k))} and produces the continuous input series Z(t) needed inthe CFE. The Learning Engine is an algorithm that allows us to detectwhen the model in the Forecast Engine is drastically out of phase withrespect to the current data and therefore a restart of the associatedmodel is warranted. In this manner the Learning Engine acts as ameta-controller to the other modules in the Forecast Engine, detectingthe need to regenerate the model paramaters and initiating the mechanismthat does so. The Window Clock keeps track of the current time and thesliding window, and Synchronization handles all of the interactionsbetween the Window Clock and the other components of the architecture.

We describe the functionality of the Continuous Forecast Engine inSection 3.4, the functionality of the Parameter Adaptation Engine inSection 3.5, the functionality of the Asynchronous Filter Bank inSection 3.3, the Learning Engine in Section 3.6, and the Lowpass Filterin Section 3.7.

Distributed Architecture

The computational algorithm of the Short-Term Price Forecaster isorganized in a four-level hierarchical structure (see FIG. 4). In thelowest level, a proprietary Asynchronous Filter Bank transforms theasynchronous market and asset data into synchronous signals. The signalis next fed to a group of algorithms called Forecast Engines. Each oneof these engines processes a subset of the portfolio and market data togenerate a forecast. The composition of these subsets is determined bythe user and by correlation information of the assets in the portfolio.For example, one such grouping can be a group of transportation-relatedassets in the NYSE.

The next level is composed of a set of Forecast Units that detect andcorrect incompatibilities in the forecasts from the Forecast Engines.This data fusion operation performed by the Forecast Units improves theoverall quality of the forecast. At the highest level is aggregatorsoftware that implements a voting schema that allows the Forecaster todetect and discard erroneous forecasts in the subgroups of theportfolio. The voting schema significantly improves the reliability ofthe forecasts.

3.3 Asynchronous Filter Bank

The Asynchronous Filter Bank inputs are equity and market data. The dataconsists of the following items: ask price, bid price, sale price andvolume for each equity and aggregated market data. Nominally, the dataitems should be available at uniform sample times. However, this is notthe case in the real-time setting. One or more data items may be missingat a sample time. Alternatively, for a given data item, we may obtainmore than one value at a sample time. The Asynchronous Filter Bank hasbeen designed to handle these anomalies in the input data.

The filter operates on known statistics about the error rate in thedata. The input data is transformed into a uniform time sequence ofestimates of the original data with known statistics.

We use {Z(t_(k))} to denote the data observations that are collected attime instance t_(k). The output from the Asynchronous Filter Bank areuniformly spaced sequences, x^(ask)(t), x^(bid)(t), x^(sell)(t),u^(data)(t), and f^(data)(t). This data is used in the ContinuousForecast and Parameter Adaptation Engines. There are 4n+p streams ofdata. Each one of them is handled by a component of the AsynchronousFilter Bank.

The methodology of the Asynchronous Filter Bank is described in HybridAsynchronous Filter, by Kohn, Brayman and Cholewinski (Clearsightdocument). The Asynchronous Filter Bank propagates the estimate. ALyaponov filter is used to produce x^(ask)(t), x^(bid)(t), x^(sell)(t),and f^(data)(t). If no data is available, the latest filtered data(corrected by the latest observations) is used to get boundaryconditions for the next propagation and to tune the parameters of theAsynchronous Filter Bank. The volume u^(data)(t) is produced byaccumulating the volume data over the uniformly spaced time intervals.If no volume data is available in a time interval, then u^(data)(t) isset to zero for that interval.

3.4 Continuous Forecast Engine

The primary role of the Continuous Forecast Engine is to generate thenominal price and risk trajectories using a repair strategy over asliding time window. The architecture of the Continuous Forecast Enginetakes advantage of the sliding window concept. It takes a nominaltrajectory, extends it and computes a repair action, and then creates anew nominal trajectory. The Continuous Forecast Engine architecture,shown in FIG. 5, consists of three components, the Repair Generator, theCoefficient Generator & Synchronization (CG&S) module, and the NominalUpdate Generator. The Nominal Update Generator computes nominal priceand risk trajectories over an extended time window using the currentestimate for the model parameters. The Repair Generator uses currentmodel parameters and nominal trajectories to provide optimal repairprice and risk trajectories over the advanced time window. The CG&Smodule computes nominal price and risk trajectories in the same timewindow using the trajectories provided by the Nominal Update Generatorand the Repair Generator. The CG&S module also processes the new data asit becomes available, computes coefficients needed in the RepairGenerator, and synchronizes with the Window Clock to coordinate thesliding window.

The Continuous Forecast Engine involves a sequence of steps over a timewindow, which are coordinated with the operations of the ParameterAdaptation Engine. The terminology of this sequencing in the ContinuousForecast Engine and the Parameter Adaptation Engine is illustrated inFIG. 6.

The CFE starts at the current time t_(f), with an initial forecastwindow [t_(f) ⁺, (t_(f)+ΔT)⁻] where t_(f) ⁺ denotes the left side of theinterval, and ΔT is the interval length. We use ΔT to denote the timehorizon for forecasts; in the current example, ΔT is six seconds. Wealso consider the repair window, [(t_(f)−ΔT)⁺,t_(f) ⁻], with a nominaltrajectory for price and risk. The time interval between data points isΔ_(data); in this example, Δ_(data) is one second. When the steps of theCFE are repeated, then the sliding window is updated from [t_(f)⁺,(t_(f)+ΔT)⁻] to [(t_(f)+Δ_(data))⁺,(t_(f)+Δ_(data)+ΔT)⁻]. Then weslide the window, or “kiss” the data h times during the time window. Welet h be such that T=hΔT. Our approximate price is good up to the horder. We use T to denote the time between updates of the parameters,{circumflex over (p)}(t). In the current example, T is 30 seconds. Thefollowing steps in CFE describe the repair strategy over a slidingwindow. A summary of the steps with the equations are given in Section3.4.7.

Step 0. Initialize window clock t, current time t_(f), time incrementΔT, the time increment for the data Δ_(data), and h such thatΔT=hΔ_(data). Also, initialize a few matrices. Assume that nominaltrajectories, parameters, and other previously computed input series areavailable.

Step 1. The CG&S reads the parameters {circumflex over (p)}(t) att=t_(f) from the Parameter Adaptation Engine, and determines if theparameters have changed from the previous iteration. It sets the timewindow for the Repair Generator, i.e., [(t_(f)−ΔT)⁺,t_(f) ⁻]. The CG&Smodule also reads the filtered data (x^(ask)(t), x^(bid)(t),x^(sell)(t), u^(data)(t), and f^(data)(t)) at the necessary times fromthe Asynchronous Filter Bank. Then the CG&S module computes input seriesand coefficients (e.g. ũ^(N)(t), f^(N)(t), φ^(N)(t), etc.) needed forthe Repair Generator and the Nominal Update Generator.

Step 2. The Repair Generator solves the repair optimization model forthe repair state y(t), the incremental risk Ω(t), and the repair actionv(t) in the time window [(t_(f)−ΔT)⁺,t_(f) ⁻]. Update the new nominaltrajectories in the repair window [(t_(f)−ΔT)⁺,t_(f) ⁻] by adding therepair trajectories to the old nominal trajectories.

Step 3. The CG&S module uses the repaired trajectories to provideinitial conditions at t_(f) ⁺ for price {tilde over (x)}^(N)(t) and riskevolution Θˆ{N}(t).

Step 4. The Nominal Update Generator solves for the nominal price {tildeover (x)}^(N)(t) and risk Θˆ{N}(t) trajectories in the forecast timewindow [t_(f) ⁺,(t_(f)+ΔT)⁻]. Output {tilde over (x)}_(i) ^(N)(t_(f)+ΔT)and √{square root over ({tilde over (Θ)}_(ii) ^(N)(t_(f)+ΔT))} for i=1,. . . , n, and save trajectories for PAE.

Step 5. Update the sliding window and related trajectories:t _(f) +t _(f)+Δ_(data)and go to Step 1.3.4.1 Time Window Updates

The price evolution and risk models for incremental and nominal modesare integrated into a scheme referred to as a sliding window. Thisstrategy assumes that the decisions at the current time depend on finiteinterval (of duration Δ_(data)) histories of the evolution updates, andthese intervals “slide” at a constant rate collecting present data (e.g.demand, uncertainty) and discarding the segments of the evolution in thepast with respect to the current time. FIG. 7 illustrates the slidingwindow and the sequence of steps in the Continuous Forecast Engine.

The Window Clock maintains the forecast time window as [t_(f)⁺,(t_(f)+ΔT)⁻] and the repair window as [(t_(f)−ΔT)⁺,t_(f) ⁻], wheret_(f) is current time. With the initial condition being the last pointof the updated evolution trajectories, the Nominal Update Generatorcomputes an optimal extension of the nominal trajectories for theforecast interval [t_(f) ⁺,(t_(f)+ΔT)⁻]. The Coefficient Generator andSynchronization module, and the Repair Generator (in Steps 3 and 4)update the coefficients and compute the repair evolution trajectoriesover the forecast interval as a function of the parameters computedusing the nominal evolution trajectory. The criterion for thisoptimization is a functional that encodes the desired behavior of theapplication, e.g. max profit. The forecasted price and risk at timet_(f)+ΔT may be output. Then the Window Clock advances the interval to[(t_(f)+Δ_(data))⁺,(t_(f)+Δ_(data)+ΔT)⁻], and updates the nominaltrajectories.

3.4.2 Nominal Update Generator Model

The Nominal Update Generator Model computes the nominal price {tildeover (x)}^(N)(t) and risk {tilde over (Θ)}^(N)(t) trajectories in theforecast time window [t_(f) ⁺,(t_(f)+ΔT)⁻]. The equations governing thiscomputation are given in the following model.

Let {tilde over (x)}(t)εR^(n), tε[t_(f) ⁺,(t_(f)+ΔT)⁻], be an estimateof the price x(t) at time t. While {tilde over (x)}(t) is not defined atimpulse time t_(f), {tilde over (x)}(t) is defined for the wholeinterval [t_(f) ⁺,(t_(f)+ΔT)⁻] so we can integrate (2) to get {tildeover (x)}(t) in that interval. It can be shown (see Appendix 4.2) that{tilde over (x)}(t) satisfies the following differential equation,${\mathbb{d}{\overset{\sim}{x}(t)}} = {{\left( {A_{0} + {\sum\limits_{i = 1}^{m}{A_{i}{u_{i}(t)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{f_{j}(t)}}}} \right){\overset{\sim}{x}(t)}{\mathbb{d}t}} + {\left( {{{Bu}(t)} + {{Cf}(t)} + {\phi(t)}} \right){\mathbb{d}t}} + {{K(t)}\left( {{x^{obs}(t)} - {\overset{\sim}{x}(t)}} \right)\delta\quad\left( {t - t_{f}} \right){\mathbb{d}t}}}$whereK(t)={tilde over (Θ)}(t)R ⁻¹and δ(t−t_(f)) is the delta distribution satisfying∫_(−∞)^(+∞)f(t)  δ  (t − τ)  𝕕t = f(τ)for any continuous function f(t). The third term on the third line ofequation (2) is a correction term due to the observation of price attime t_(f). We use x^(sell)(t) as our x^(obs)(t). The K(t) expression isreferred to as the gain, where R is an n×n symmetric positive definitematrix representing the noise covariance matrix. The risk {tilde over(Θ)}(t) is discussed next.

The central second moment conditioned in the continuous input seriesz(t) based on the input data of x(t), {tilde over (Θ)}(t)εR^(n×n),tε[t_(f) ⁺,(t_(f)+ΔT)⁻], measures the risk and it can be shown (seeAppendix ??) that it satisfies the following differential equation${\mathbb{d}{\overset{\sim}{\Theta}(t)}} = {{\left( {A_{0} + {\sum\limits_{i = 1}^{m}{A_{i}{u_{i}(t)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{f_{j}(t)}}}} \right){\overset{\sim}{\Theta}(t)}{\mathbb{d}t}} + {{\overset{\sim}{\Theta}(t)}\left( {A_{0} + {\sum\limits_{i = 1}^{m}{A_{i}{u_{i}(t)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{f_{j}(t)}}}} \right)^{T}{\mathbb{d}t}} + {\left( {{Q(t)} - {{\overset{\sim}{\Theta}(t)}R^{- 1}{\overset{\sim}{\Theta}(t)}}} \right){{\mathbb{d}t}.}}}$Equation (3) propagates the parameters of the uncertainty ellipsoid{tilde over (Θ)}(t) that models the risk as a function of exogenousuncertainty at time t. In equation (3), Q(t) defines the uncertaintyellipsoid and R is the same symmetric positive definite matrix involvedin (2).The Nominal Update Generator uses x and {tilde over (Θ)} models (2) and(3) to create our nominal prediction over the forecast window. We usethe superscript N to denote the nominal trajectories {tilde over(x)}^(N)(t) and {tilde over (Θ)}^(N)(t) for tε[t_(f) ⁺,(t_(f)+ΔT)⁻]. Weuse the Parameter Adaptation Engine to estimate the parameters A₀,A_(i), i=1, . . . ,m, D_(j), j=1, . . . ,p, B, and C. The nominal valuesf^(N)(t), φ^(N)(t), and Q^(N)(t) are computed from the data in the CG&Smodule (see Section 3.4.6). The initial conditions needed to compute{tilde over (x)}^(N)(t) and {tilde over (Θ)}^(N)(t) are provided fromthe Repair Generator and the repaired trajectories {tilde over(x)}^(NN)(t) and {tilde over (Θ)}^(NN)(t) for the repair window[(t_(f)−ΔT)⁻,t_(f) ⁺]. We next describe how to identify the initialconditions. Then we specify the details for creating the nominaltrajectories.

The initial condition of {tilde over (x)}(t) at time t_(f) ⁺ needs to becorrected by our observed data at that time, x^(sell)(t_(f)). We assumethis correction is an impulse. For the nominal prediction at forecastingtime t_(f) ⁺, assume u(t)=ũ^(N)(t_(f)) for tε[t_(f) ⁺,(t_(f)+ΔT)⁻](i.e., u(t) is a constant in the forecast time interval). We denote theinitial conditions {tilde over (x)}^(IC) and {tilde over (Θ)}^(IC) asthe values of {tilde over (x)}^(N)(t_(f) ⁺) and {tilde over(Θ)}^(N)(t_(f) ⁺) respectively. The initial conditions for {tilde over(x)}^(IC) include a correction term corresponding to the third line inequation (2) that includes the observed value x^(sell)(t_(f)). Theinitial conditions are updated as follows{tilde over (x)} ^(IC) ={tilde over (x)} ^(NN)(t _(f) ⁻)+{tilde over(Θ)}^(NN)(t _(f) ⁻)R ⁻¹(x ^(sell)(t _(f))−{tilde over (x)} ^(NN)(t _(f)⁻))where {tilde over (x)}^(NN)(t_(f) ⁻) and õ^(NN)(t_(f) ⁻) are given byrepair, and{tilde over (Θ)}^(IC)={tilde over (Θ)}^(NN)(t _(f) ⁻)The correction term −{tilde over (Θ)}R⁻¹{tilde over (Θ)} in (3)continuously updates {tilde over (Θ)} so that the initial conditions{tilde over (Θ)}^(IC) equal the repaired value {tilde over(Θ)}^(NN)(t_(f) ⁻).

Now we forecast price and risk. We forecast price by integratingequation (2) where we use ũ^(N)(t_(f)), f^(N)(t_(f)), and φ^(N)(t) asconstant values over the forecast window. The correction term in (2) hasalready been accounted for in the initial conditions (4) and is notneeded in the integration. Thus we integrate the following differentialequation to obtain the nominal price trajectory,$\frac{\mathbb{d}{{\overset{\sim}{x}}^{N}(t)}}{\mathbb{d}t} = {{\left( {A_{0} + {\sum\limits_{i = 1}^{m}{A_{i}{{\overset{\sim}{u}}_{i}^{N}\left( t_{f} \right)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{f_{j}^{N}\left( t_{f} \right)}}}} \right){{\overset{\sim}{x}}^{N}(t)}} + {B{{\overset{\sim}{u}}^{N}\left( t_{f} \right)}} + {{Cf}^{N}\left( t_{f} \right)} + {\phi^{N}\left( t_{f} \right)}}$with initial conditions given in (4), and over t between t_(f) ⁺ and(t_(f)+ΔT)⁻.

The risk trajectory is forecasted by integrating (3) with constantvalues for ũ^(N)(t_(f)), f^(N)(t_(f)), and Q^(N)(t_(f)), yielding thefollowing differential equation,$\frac{\mathbb{d}{{\overset{\sim}{\Theta}}^{N}(t)}}{\mathbb{d}t} = {{\left( {A_{0} + {\sum\limits_{i = 1}^{m}{A_{i}{{\overset{\sim}{u}}_{i}^{N}\left( t_{f} \right)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{f_{j}^{N}\left( t_{f} \right)}}}} \right){{\overset{\sim}{\Theta}}^{N}(t)}} + {{{\overset{\sim}{\Theta}}^{N}(t)}\left( {A_{0} + {\sum\limits_{i = 1}^{m}{A_{i}{{\overset{\sim}{u}}_{i}^{N}\left( t_{f} \right)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{f_{j}^{N}\left( t_{f} \right)}}}} \right)^{T}} - {{{\overset{\sim}{\Theta}}^{N}\left( t_{f} \right)}R^{- 1}{{\overset{\sim}{\Theta}}^{N}\left( t_{f} \right)}} + {Q^{N}\left( t_{f} \right)}}$with initial conditions given in (5), and over t between t between t_(f)⁺ and (t_(f)+ΔT)⁻.

The initial conditions (4) and (5) are computed in Step 3 of the CFE,and the nominal trajectories are updated in Step 4 of the CFE.

3.4.3 Repair Generator Model

The repair model uses a singular perturbation to obtain an incrementalvariation of the price and risk evolution trajectories with respect tocomputed nominal trajectories:{tilde over (x)} ^(NN)(t)={tilde over (x)} ^(N)(t)+εy(t){tilde over (Θ)}^(NN)(t)={tilde over (Θ)}^(N)(t)+εΩ(t)ũ ^(NN)(t)=ũ ^(N)(t)+εv(t)for tε[(t_(f)−ΔT)⁺,t_(f) ⁻] where the NN superscript denotes the newnominal trajectory, and ε is the perturbation parameter determined bythe window characteristic, ε=Δ_(data)/ΔT=1/h. From the Ekeland principle[11], for a window of width ΔT and increment Δ_(data) with no forgettingfunction, we know that $ɛ = {\frac{\Delta_{data}}{\Delta\quad T}.}$In (8)-(10), y(t) is the price repair, Ω(t) is the incremental risk, andv(t) is the repair action.

We also use a singular perturbation forf ^(NN)(t)=f ^(N)(t)+εg(t)φ^(NN)(t)=φ^(N)(t)+εξ(t)Q ^(NN)(t)=Q ^(N)(t)+εW(t).where g(t) is the incremental force by the environment, ξ(t) is theuncertainty in the market, and W(t) is the incremental externaluncertainty.

In the CG&S module, g(t) is approximated by taking the difference ofreal-time data at time t and at time t−Δ_(data). We setf^(NN)(t)=f^(N)(t)=f^(data)(t) andf^(N)(t−Δ_(data))=f^(data)(t−Δ_(data)), yielding${g^{N}(t)} = {\frac{{f^{N}(t)} - {f^{N}\left( {t - \Delta_{data}} \right)}}{ɛ}.}$Similarly, ξ(t) is estimated using φ^(NN)(t)=φ^(N)(t) at time t andφ^(N)(t−Δ_(data)) at time t−Δ_(data), yielding${\xi^{N}(t)} = {\frac{{\phi^{N}(t)} - {\phi^{N}\left( {t - \Delta_{data}} \right)}}{ɛ}.}$And the same for W(t),${W^{N}(t)} = {\frac{{Q^{N}(t)} - {Q^{N}\left( {t - \Delta_{data}} \right)}}{ɛ}.}$The data for f^(N)(t) comes directly from the filtered data,f ^(N)(t)=f ^(data)(t).We estimate φ^(N)(t), the average value of the perturbation introducedby the market, by using the available data, x^(sell), u^(data), andf^(data) in equation (6), yielding $\begin{matrix}{{\phi^{N}(t)} = {\left( {{x^{sell}(t)} - {x^{sell}\left( {t - \Delta_{data}} \right)}} \right) -}} \\{{\left( {A_{0} + {\sum\limits_{i = 1}^{m}{A_{i}{u_{i}^{data}(t)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{f_{j}^{N}(t)}}}} \right){x^{sell}(t)}} -} \\{{{Bu}^{data}(t)} - {{{Cf}^{data}(t)}.}}\end{matrix}$

The estimate for the covariance matrix Q_(ij) ^(N)(t), the last term inequation (7), is also estimated using available data, x^(ask), x^(bid),and coefficients α, ε_(Q), and α_(Q), yielding $\begin{matrix}{{Q_{ij}^{N}(t)} = {ɛ_{Q}^{2} + {\max\limits_{\sigma \in {\lbrack{{t - {\Delta\quad T}},t}\rbrack}}\left\{ {\frac{1}{2}\left( {{\sqrt{\alpha}{{{x_{i}^{ask}(\sigma)} - {x_{i}^{bid}(\sigma)}}}} +} \right.} \right.}}} \\\left. {\left. \alpha_{Q} \right)\left( {{\sqrt{\alpha}{{{x_{j}^{ask}(\sigma)} - {x_{j}^{bid}(\sigma)}}}} + \alpha_{Q}} \right)} \right\}\end{matrix}$ for  i, j = 1, …  , n.

To derive the differential equation for the price repair y(t), startingfrom (8), we have,$\frac{\mathbb{d}\left( {{\overset{\sim}{x}}^{NN}(t)} \right)}{\mathbb{d}t} = \frac{\mathbb{d}\left( {{{\overset{\sim}{x}}^{N}(t)} + {ɛ\quad{y(t)}}} \right)}{\mathbb{d}t}$which we can expand using equation (2), and then dropping the terms oforder ε², we get $\begin{matrix}{\frac{\mathbb{d}{y(t)}}{\mathbb{d}t} = {{{\overset{\sim}{A}(t)}{y(t)}} + {\left( {{\sum\limits_{i = 1}^{m}{A_{i}{v_{i}(t)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{g_{j}^{N}(t)}}}} \right){\overset{\sim}{x}}^{N}(t)} +}} \\{{{Bv}(t)} + {{Cg}^{N}(t)} + {\xi^{N}(t)}}\end{matrix}$ where${\overset{\sim}{A}(t)} = {\left( {A_{0} + {\sum\limits_{i = 1}^{m}{A_{i}{{\overset{\sim}{u}}_{i}^{N}(t)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{f_{j}^{N}(t)}}}} \right).}$Because the control variable is v(t), we rewrite (14) to highlight itslinear form, $\begin{matrix}{\frac{\mathbb{d}{y(t)}}{\mathbb{d}t} = {{{\overset{\sim}{A}(t)}{y(t)}} + {\sum\limits_{i = 1}^{m}{\left( {A_{i}{{\overset{\sim}{x}}^{N}(t)}} \right){v_{i}(t)}}} + {{Bv}(t)} +}} \\{{\sum\limits_{j = 1}^{p}{D_{j}{{\overset{\sim}{x}}^{N}(t)}{g_{j}^{N}(t)}}} + {{Cg}^{N}(t)} + {{\xi^{N}(t)}.}}\end{matrix}$For notational and computational convenience, in addition to definingÃ(t), we also define {tilde over (B)}(t) to be an n×m matrix{tilde over (B)}(t)=(Ã ^(x)(t)+B)where Ã^(x)(t) is an n×m matrix with the ith column of Ã^(x)(t), fori=1, . . . ,m, given byÃ _(i) ^(x)(t)=A _(i) {tilde over (x)} ^(N)(t).And {tilde over (C)}(t) is an n×1 vector given by${\overset{\sim}{C}(t)} = {{\sum\limits_{j = 1}^{p}{{g_{j}^{N}(t)}D_{j}{{\overset{\sim}{x}}^{N}(t)}}} + {{Cg}^{N}(t)} + {{\xi^{N}(t)}.}}$The coefficients Ã(t), {tilde over (B)}(t), and {tilde over (C)}(t) arecomputed in Step 1 of the Continuous Forecast Engine by the CG&S module,where g^(N)(t) and ξ^(N)(t) are estimated from the data. Now we canrewrite the dynamics equation in (15) as$\frac{\mathbb{d}{y(t)}}{\mathbb{d}t} = {{{\overset{\sim}{A}(t)}{y(t)}} + {{\overset{\sim}{B}(t)}{v(t)}} + {{\overset{\sim}{C}(t)}.}}$Similarly, from (9), we can expand${\frac{\mathbb{d}\left( {{\overset{\sim}{\Theta}}^{NN}(t)} \right)}{\mathbb{d}t} = \frac{\mathbb{d}\left( {{{\overset{\sim}{\Theta}}^{N}(t)} + {ɛ\quad{\Omega(t)}}} \right)}{\mathbb{d}t}},$and using Equation (3) it can be shown that $\begin{matrix}{\frac{{\mathbb{d}\Omega}\quad(t)}{\mathbb{d}t} = {{\left( {A_{0} + {\sum\limits_{i = 1}^{m}{A_{i}{{\overset{\sim}{u}}_{i}^{N}(t)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{f_{j}^{N}(t)}}}} \right)\Omega\quad(t)} +}} \\{{{\Omega(t)}\left( {A_{0} + {\sum\limits_{i = 1}^{m}{A_{i}{{\overset{\sim}{u}}_{i}^{N}(t)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{f_{j}^{N}(t)}}}} \right)^{T}} -} \\{{{{\overset{\sim}{\Theta}}^{N}(t)}R^{- 1}{\Omega(t)}} - {{\Omega(t)}R^{- 1}{{\overset{\sim}{\Theta}}^{N}(t)}} +} \\{{\sum\limits_{i = 1}^{m}{A_{i}^{T}{v_{i}(t)}{{\overset{\sim}{\Theta}}^{N}(t)}}} + {\sum\limits_{i = 1}^{m}{A_{i}{v_{i}(t)}{{\overset{\sim}{\Theta}}^{N}(t)}}} +} \\{{\sum\limits_{j = 1}^{p}{{{\overset{\sim}{\Theta}}^{N}(t)}D_{j}^{T}{g_{j}^{N}(t)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{{\overset{\sim}{\Theta}}^{N}(t)}{g_{j}^{N}(t)}}} + {{W^{N}(t)}.}}\end{matrix}$For notational and computational convenience, we define{tilde over (V)} _(i)(t)={tilde over (Θ)}^(N)(t)A _(i) ^(T) for i=1, . .. ,mand${\overset{\sim}{D}(t)} = {{\sum\limits_{j = 1}^{p}{{{\overset{\sim}{\Theta}}^{N}(t)}D_{j}^{T}{g_{j}^{N}(t)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{{\overset{\sim}{\Theta}}^{N}(t)}{g_{j}^{N}(t)}}} + {W^{N}(t)}}$which are computed in Step 1 of the Continuous Forecast Engine. Usingthe notation for Ã(t), {tilde over (V)}_(i)(t), we can rewrite (17) as$\begin{matrix}{\frac{\mathbb{d}{\Omega(t)}}{\mathbb{d}t} = {{{\overset{\sim}{A}(t)}{\Omega(t)}} + {{\Omega(t)}\left( {\overset{\sim}{A}(t)} \right)^{T}} -}} \\{{{{\overset{\sim}{\Theta}}^{N}(t)}R^{- 1}{\Omega(t)}} - {{\Omega(t)}R^{- 1}{{\overset{\sim}{\Theta}}^{N}(t)}} +} \\{{\sum\limits_{i = 1}^{m}{{{\overset{\sim}{V}}_{i}(t)}{v_{i}(t)}}} + {\sum\limits_{i = 1}^{m}{\left( {{\overset{\sim}{V}}_{i}(t)} \right)^{T}{v_{i}(t)}}} + {\overset{\sim}{D}(t)}}\end{matrix}$Equations (15) and (17) constitute the model for the repair module. Thecontrol variable is v(t) which can be interpreted as a fictitiousincremental volume caused by the uncertainty in the market and theaccuracy of the model. Notice that the dynamics are functions of thecontrol variable v(t), so we are controlling the uncertainty throughv(t). The repair criterion in the following section completes thedefinition of the repair optimization model.3.4.4 Repair Criteria

The repair criterion uses a least squares criterion for the estimatedrepair trajectories. It represents the user-defined running criterionrate (e.g. profit-risk combination).The criterion for the Repair Generator is a functional of the formJ^(R)(v, s) = ∫_(t_(f) − Δ  T)^(t_(f))δ  Π  (y(t), Ω(t), v(t), t)  𝕕t,where $\begin{matrix}{{\delta\quad\Pi\quad\left( {{y(t)},{\Omega(t)},{v(t)},t} \right)} = {\left( {{{\overset{\sim}{x}}^{N}(t)} + {ɛ\quad{y(t)}} - {x^{sell}(t)}} \right)^{T}{S\left( {{{\overset{\sim}{x}}^{N}(t)} +} \right.}}} \\{\left. {{ɛ\quad{y(t)}} - {x^{sell}(t)}} \right) + \left( {{diag}\left( {{{\overset{\sim}{\Theta}}^{N}(t)} + {ɛ\quad{\Omega(t)}} -} \right.} \right.} \\{\left. \left. {\Theta^{data}(t)} \right) \right)^{T}{R^{\Omega}\left( {{diag}\left( {{{\overset{\sim}{\Theta}}^{N}(t)} + {ɛ\quad\Omega\quad(t)} -} \right.} \right.}} \\{\left. \left. {\Theta^{data}(t)} \right) \right) + \left( {{{\overset{\sim}{u}}^{N}(t)} + {ɛ\quad{v(t)}} - {u^{data}(t)}} \right)^{T}} \\{M\left( {{{\overset{\sim}{u}}^{N}(t)} + {ɛ\quad{v(t)}} - {u^{data}(t)}} \right)}\end{matrix}$and ε=Δ_(data)/ΔT=1/h, and S, R^(Ω), and M are symmetric positivedefinite matrices where S and M have small positive values while R^(Ω)has large positive values to penalize the variance heavily. The notationdiag (A) of an n×n matrix A used here is ${{diag}(A)} = \begin{bmatrix}A_{11} \\A_{22} \\\vdots \\A_{nn}\end{bmatrix}$andΘ_(ii) ^(data)(t)=ε_(Q) ²+(√{square root over (α)}|x _(i) ^(bid)(t)−x_(i) ^(ask)(t)|+α_(Q))²for each i=1, . . . , n.3.4.5 Repair Optimization Problem

The repair optimization problem for the Repair Generator for each windowupdate interval [t₁, t₂] is summarized here as$\min\limits_{v}{\int_{t_{1}}^{t_{2}}{\delta\quad\Pi\quad\left( {{y(t)},{\Omega(t)},{v(t)},t} \right)\quad{\mathbb{d}t}}}$subject  to$\frac{\mathbb{d}{y(t)}}{\mathbb{d}t} = {{{\overset{\sim}{A}(t)}{y(t)}} + {{\overset{\sim}{B}(t)}{v(t)}} + {\overset{\sim}{C}(t)}}$as  in  (ref:repair  y  3) $\begin{matrix}{\frac{{\mathbb{d}\Omega}\quad(t)}{\mathbb{d}t} = {{{\overset{\sim}{A}(t)}\quad\Omega\quad(t)} + {\Omega\quad(t)\left( \quad{\overset{\sim}{A}(t)} \right)^{T}} -}} \\{{{{\overset{\sim}{\Theta}}^{N}(t)}R^{- 1}\Omega\quad(t)} - {\Omega\quad(t)R^{- 1}{{\overset{\sim}{\Theta}}^{N}(t)}} +} \\{{\sum\limits_{i = 1}^{m}{{{\overset{\sim}{V}}_{i}(t)}{v_{i}(t)}}} + {\sum\limits_{i = 1}^{m}{\left( {{\overset{\sim}{V}}_{i}(t)} \right)^{T}{v_{i}(t)}}} + {\overset{\sim}{D}(t)}}\end{matrix}$ as  in  (ref:RepairOmega  2)where the repair criterion δπ(y(t), Ω(t), v(t), t) is given in (20).Initial conditions are given as y(t₁)=0 and Ω(t₁)=0.

Repair provides y(t), Ω(t), and v(t) for tε[(t_(f)−ΔT)⁺,t_(f) ⁻].

3.4.6 Coefficient Generator and Synchronization

Coefficient Generator and Synchronization (CG&S) is involved in steps 1,3 and 5 of the Continuous Forecast Engine. In general, CG&S reads thereal-time data trajectories, and prepares the data and coefficients foruse in the Repair Generator and in the Nominal Update Generator. CG&Salso updates the information and synchronizes the computations with thesliding window.

In Step 1 of the CFE, the CG&S module reads the following data at timet=t_(f): x^(ask)(t), x^(bid)(t), x^(sell)(t), u^(data)(t), f^(data)(t).The data is used to compute Q^(N)(t) for use in the Nominal UpdateGenerator. Because the bid/ask prices give upper and lower bounds onmarket price (at time t), we can interpret them as the variance,standard deviation, or percentiles, on the average market price. Thedata is also used in the Repair Generator.

The data above is evaluated using values at t=t_(f) and held constantthroughout the incremental window [t_(f) ⁺,(t_(f)+ΔT)⁻].

The CG&S synchronizes with the Parameter Adaptation Engine to updateparameters {circumflex over (p)}(t) at appropriate times, and holdsthese constant throughout the incremental window [t_(f) ⁺,(t_(f)+ΔT)⁻].In Step 3 of the CFE, the CG&S module computes the coefficients neededfor the Repair Generator to solve the repair optimization model in thesliding time window [(t_(f)−ΔT+Δ_(data))⁺,(t_(f)+Δ_(data))⁻]. Thecoefficients computed are:${\overset{\sim}{A}(t)} = \left( {A_{0} + {\sum\limits_{i = 1}^{m}{A_{i}{{\overset{\sim}{u}}_{i}^{N}(t)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{f_{j}^{N}(t)}}}} \right)$${{{\overset{\sim}{A}}_{i}^{x}(t)} = {{A_{i}{{\overset{\sim}{x}}^{N}(t)}\quad{for}\quad i} = 1}},\ldots\quad,m$${\overset{\sim}{B}(t)} = \left( {{{\overset{\sim}{A}}^{x}(t)} + B} \right)$${{\overset{\sim}{C}(t)} = {{{\sum\limits_{j = 1}^{p}{{g_{j}^{N}(t)}D_{j}{{\overset{\sim}{x}}^{N}(t)}}} + {{Cg}^{N}(t)} + {{{\xi^{N}(t)}.{{\overset{\sim}{\Theta}}^{N}(t)}}A_{i}^{T}\quad{for}\quad i}} = 1}},\ldots\quad,m$${{A_{i}{{\overset{\sim}{\Theta}}^{N}(t)}\quad{for}\quad i} = 1},\ldots\quad,m$${{{{\overset{\sim}{\Theta}}^{N}(t)}D_{j}^{T}\quad{for}\quad j} = 1},\ldots\quad,p$${{D_{j}{{\overset{\sim}{\Theta}}^{N}(t)}\quad{for}\quad j} = 1},\ldots\quad,p$In Step 5 of the CFE, the CG&S module updates the new nominaltrajectories in the sliding time window[(t_{f}−ΔT+Δ_{data})⁺,(t_{f}+Δ_{data})⁻]{tilde over (x)} ^(N)(t)←{tilde over (x)} ^(N)(t)+εy(t){tilde over (Θ)}^(N)(t)←{tilde over (Θ)} ^(N)(t)+εΩ(t)ũ ^(N)(t)←ũ ^(N)(t)+εv(t)where the Repair Generator provides y(t), Ω(t), and v(t).3.4.7 Summary of the Continuous Forecast EngineHere we summarize the steps in the Continuous Forecast Engine.

Step 0. Initialize window clock t, current time t_(f), time interval forthe forecast ΔT, the time increment for the filtered data Δ_(data), andh such that ΔT=hΔ_(data). Also, initialize S, R^(Ω), and M, where S andR^(Ω) are diagonal n×n matrices and M is a diagonal m×m matrix, and Sand M have small positive values while R^(Ω) has large positive values.Let ε=Δ_(data)/ΔT=1/h. Set α, ε_{Q}, and α_{Q}, for use in α, ε_(Q), andα_(Q).

Assume that the nominal trajectories for price {tilde over (x)}^(N)(t),risk evolution {tilde over (Θ)}^(N)(t), and volume ũ^(N)(t) as well asmodel parameters {circumflex over (p)}(t) and data (x^(ask)(t),x^(bid)(t), x^(sell)(t), u^(data)(t), f^(data)(t), and Δ_(data)) areavailable over the interval [(t_(f)−ΔT)⁺,t_(f) ⁻]. Also assume thatpreviously computed input series (e.g. f^(N)(t), φ^(N)(t), and Q^(N)(t))are also available over the interval [(t_(f)−ΔT)⁺,t_(f) ⁻].

Step 1. The CG&S module reads the parameters {circumflex over (p)}(t)(A₀, A_(i), i=1, . . . ,m, D_(j), j=1, . . . ,p, B, and C), at t=t_(f),from the Parameter Adaptation Engine, and determines if the parametershave changed from the previous iteration. It also computes input seriesand coefficients and sets the time window for the Repair Generator,i.e., [(t_(f)−ΔT)⁺,t_(f) ⁻]. Also, it inputs the data (x^(ask)(t),x^(bid)(t), x^(sell)(t), u^(data)(t), and f^(data)(t)) at time t_(f)from the Asynchronous Filter Bank.The following input series and coefficients are computed for t=t_(f):${{\overset{\sim}{u}}^{N}\left( t_{f} \right)} = {{\overset{\sim}{u}}^{N}\left( {t_{f} - \Delta_{data}} \right)}$f^(N)(t) = f^(data)(t)${\overset{\sim}{A}(t)} = \left( {A_{0} + {\sum\limits_{i = 1}^{m}{A_{i}{{\overset{\sim}{u}}_{i}^{N}(t)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{f_{j}^{N}(t)}}}} \right)$$\begin{matrix}{{\phi^{N}(t)} = {\left( {{x^{\quad{sell}}(t)} - {x^{\quad{sell}}\left( {t - \Delta_{\quad{data}}} \right)}} \right) - \left( {A_{0} + {\sum\limits_{i = 1}^{m}{A_{i}{u_{i}^{data}(t)}}} +} \right.}} \\{{\left. {\sum\limits_{j = 1}^{p}{D_{j}{f_{j}^{N}(t)}}} \right){x^{sell}(t)}} - {{Bu}^{data}(t)} - {{Cf}^{data}(t)}}\end{matrix}$ $\begin{matrix}{{Q_{ij}^{N}(t)} = {ɛ_{Q}^{2} + {\max\limits_{\sigma \in {\lbrack{{t - {\Delta\quad T}},t}\rbrack}}\left\{ {\frac{1}{2}\left( {{\sqrt{\alpha\quad}{{{x_{i}^{ask}(\sigma)} - {x_{i}^{bid}(\sigma)}}}} +} \right.} \right.}}} \\\left. {\left. \alpha_{Q} \right)\left( {{\sqrt{\alpha\quad}{{{x_{j}^{ask}(\sigma)} - {x_{j}^{bid}(\sigma)}}}} + \alpha_{Q}} \right)} \right\}\end{matrix}$   for  i, j = 1, …  , n${g^{N}(t)} = \frac{{f^{N}(t)} - {f^{N}\left( {t - \Delta_{data}} \right)}}{ɛ}$${\xi^{N}(t)} = \frac{{\phi^{N}(t)} - {\phi^{N}\left( {t - \Delta_{data}} \right)}}{ɛ}$${W^{N}(t)} = \frac{{Q^{N}(t)} - {Q^{N}\left( {t - \Delta_{data}} \right)}}{ɛ}$${\gamma_{y}(t)} = {{{\overset{\sim}{x}}^{N}(t)} - {x^{sell}(t)}}$${{\Theta_{ii}^{data}(t)} = {{ɛ_{Q}^{2} + {\left( {{\sqrt{\alpha}{{{x_{i}^{bid}(t)} - {x_{i}^{ask}(t)}}}} + \alpha_{Q}} \right)^{2}\quad{for}\quad i}} = 1}},\ldots\quad,n$${\gamma_{\Omega}(t)} = {{{diag}\left( {{\overset{\sim}{\Theta}}^{N}(t)} \right)} - {{diag}\left( {\Theta^{data}(t)} \right)}}$${\gamma_{v}(t)} = {{{\overset{\sim}{u}}^{N}(t)} - {u^{data}(t)}}$${\overset{\sim}{B}(t)} = {\left\lbrack {A_{1}{{\overset{\sim}{x}}^{N}(t)}{\cdots }A_{m}{{\overset{\sim}{x}}^{N}(t)}} \right\rbrack + B}$${\overset{\sim}{C}(t)} = {{\sum\limits_{j = 1}^{p}{{g_{j}^{N}(t)}D_{j}{{\overset{\sim}{x}}^{N}(t)}}} + {{Cg}^{N}(t)} + {\xi^{N}(t)}}$${{{\overset{\sim}{V}}_{i}(t)} = {{{{\overset{\sim}{\Theta}}^{N}(t)}A_{i}^{T}\quad{for}\quad i} = 1}},\ldots\quad,m$${\overset{\sim}{D}(t)} = {{\sum\limits_{j = 1}^{p}{{{\overset{\sim}{\Theta}}^{N}(t)}D_{j}^{T}{g_{j}^{N}(t)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{{\overset{\sim}{\Theta}}^{N}(t)}{g_{j}^{N}(t)}}} + {W^{N}(t)}}$Step 2. The Repair Generator uses RSolver to solve the repairoptimization model for the repair state y(t), the incremental risk Ω(t),and the repair action v(t) in the time window [t_(f)−ΔT,t_(f)].Specifically, solve$\min\limits_{v}{\int_{t_{f} - {\Delta\quad T}}^{t_{f}}{\delta\quad\Pi\quad\left( {{y(t)},{\Omega(t)},{v(t)},t} \right)\text{)}\quad{\mathbb{d}t}}}$subject  to$\frac{\mathbb{d}{y(t)}}{\mathbb{d}t} = {{{\overset{\sim}{A}(t)}{y(t)}} + {{\overset{\sim}{B}(t)}{v(t)}} + {{\overset{\sim}{C}(t)}\begin{matrix}{\frac{{\mathbb{d}\Omega}\quad(t)}{\mathbb{d}t} = {{{\overset{\sim}{A}(t)}\quad\Omega\quad(t)} + {\Omega\quad(t)\left( \quad{\overset{\sim}{A}(t)} \right)^{T}} -}} \\{{{{\overset{\sim}{\Theta}}^{N}(t)}R^{- 1}\Omega\quad(t)} - {\Omega\quad(t)R^{- 1}{{\overset{\sim}{\Theta}}^{N}(t)}} +} \\{{\sum\limits_{i = 1}^{m}{{{\overset{\sim}{V}}_{i}(t)}{v_{i}(t)}}} + {\sum\limits_{i = 1}^{m}{\left( {{\overset{\sim}{V}}_{i}(t)} \right)^{T}{v_{i}(t)}}} + {\overset{\sim}{D}(t)}}\end{matrix}{where}\begin{matrix}{{\delta\quad{\Pi\left( {{y(t)},{\Omega(t)},{v(t)},t} \right)}} = {{\left( {{\gamma_{y}(t)} + {ɛ\quad{y(t)}}} \right)^{T}{S\left( {{\gamma_{y}(t)} + {{ɛy}(t)}} \right)}} +}} \\{\left( {{\gamma_{\Omega}(t)} + {{diag}\left( {ɛ\quad{\Omega(t)}} \right)}} \right)^{T}{R^{\Omega}\left( {{\gamma_{\Omega}(t)} +} \right.}} \\{\left. {{diag}\left( {ɛ\quad\Omega\quad(t)} \right)} \right) + \left( {{\gamma_{v}(t)} + {ɛ\quad{v(t)}}} \right)^{T}} \\{M\left( {{\gamma_{v}(t)} + {ɛ\quad{v(t)}}} \right)}\end{matrix}}}$and ε=Δ_(data)/ΔT=1/h, and initial conditions arey(t _(f) −ΔT)=0Ω(t _(f) −ΔT)=0.The Repair Generator updates the new nominal trajectories fortε[(t_(f)−ΔT)⁺,t_(f) ⁻] by adding the repair trajectories to theprevious nominals,{tilde over (x)} ^(NN)(t)={tilde over (x)} ^(N)(t)+εy(t){tilde over (Θ)}^(NN)(t)={tilde over (Θ)}^(N)(t)+εΩ(t)ũ ^(NN)(t)=ũ ^(N)(t)+εv(t)Step 3. The CG&S module uses the repaired trajectories to provideinitial conditions for price {tilde over (x)}^(N)(t) and risk evolution{tilde over (Θ)}^(N)(t) at t=t_(j),{tilde over (x)} ^(IC) ={tilde over (x)} ^(NN)(t _(f) ⁻)+{tilde over(Θ)}^(NN)(t _(f) ⁻)R ⁻¹(x ^(sell)(t _(f))−{tilde over (x)} ^(NN)(t _(f)⁻)){tilde over (Θ)}^(IC)={tilde over (Θ)}^(NN)(t _(f) ⁻).It also calculates {tilde over (E)}(t_(f)) and Ã^(NN)(t_(f)) usingũ^(NN)(t_(f))),{tilde over (E)}(t _(f))=Bũ ^(NN)(t _(f))+Cf ^(N)(t _(f))+φ^(N)(t _(f))${{\overset{\sim}{A}}^{NN}\left( t_{f} \right)} = {\left( {A_{0} + {\sum\limits_{i = 1}^{m}{A_{i}{{\overset{\sim}{u}}_{i}^{NN}\left( t_{f} \right)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{f_{j}^{N}\left( t_{f} \right)}}}} \right).}$Note: Add update for Q^(N)(t_(f)).Step 4. The Nominal Update Generator uses the initial conditions, {tildeover (x)}^(IC) and {tilde over (Θ)}^(IC), and coefficientsÃ^(NN)(t_(f)), {tilde over (E)}(t_(f)), and Q^(N)(t_(f)), from the CG&Smodule to solve for the nominal price {tilde over (x)}^(N)(t) and risk{tilde over (Θ)}^(N)(t) trajectories in the incremental time windowtε[t_(f) ⁺,(t_(f)+ΔT)⁻]. Specifically, solve$\frac{\mathbb{d}{{\overset{\sim}{x}}^{N}(t)}}{\mathbb{d}t} = {{{{\overset{\sim}{A}}^{NN}\left( t_{f} \right)}{{\overset{\sim}{x}}^{N}(t)}} + {\overset{\sim}{E}\left( t_{f} \right)}}$$\begin{matrix}{\frac{\mathbb{d}{{\overset{\sim}{\Theta}}^{N}(t)}}{\mathbb{d}t} = {{{{\overset{\sim}{\Theta}}^{N}(t)}\left( {{\overset{\sim}{A}}^{NN}\left( t_{f} \right)} \right)^{T}} + {{{\overset{\sim}{A}}^{NN}\left( t_{f} \right)}{{\overset{\sim}{\Theta}}^{N}(t)}} -}} \\{{{{\overset{\sim}{\Theta}}^{N}(t)}R^{- 1}\quad{{\overset{\sim}{\Theta}}^{N}(t)}} + {Q^{\quad N}\left( t_{\quad f} \right)}}\end{matrix}$with initial conditions {tilde over (x)}^(IC) and {tilde over (Θ)}_(IC),and the coefficients Ã^(NN)(t_(f)), {tilde over (E)}(t_(f)), andQ^(N)(t_(f)) are kept constant at time t_(f) throughout the time window.

Output {tilde over (x)}^(N)(t_(f)+ΔT) and √{square root over ({tildeover (Θ)}_(ii) ^(N)(t_(f)+ΔT))} for i=1, . . . ,n, and save {tilde over(x)}^(N)(t), {tilde over (Θ)}^(N)(t), d{tilde over (x)}^(N)(t)/dt, andd{tilde over (Θ)}^(N)(t)/dt every Δ_(data) throughout the time window inthe database for use in the Parameter Adaptation Engine and theController.

Step 5. Update the sliding windowt _(f) ←t _(f)+Δ_(data)and trajectories for tε[(t_(f)−ΔT)⁺,t_(f) ⁻]{tilde over (x)} ^(N)(t)←{tilde over (x)} ^(NN)(t){tilde over (Θ)}^(N)(t)←{tilde over (Θ)}^(NN)(t)and for tε[(t_(f)−ΔT)⁺,t_(f) ⁻],ũ ^(N)(t)←ũ ^(NN)(t)and go to Step 1.3.5 Parameter Adaptation EngineThe inputs to the Parameter Adaptation Engine (PAE) are the trajectoriesgenerated by the Continuous Forecast Engine. These inputs are thetrajectories X=({tilde over (x)}^(N)(t), {tilde over (Θ)}^(N)(t),ũ^(N)(t), f^(N)(t), Q^(N)(t)). The Parameter Adaptation Engine generatesperiodically updates to estimates of the parameters Pars=(A₀, A_(i),i=1, . . . ,m, D_(j), j=1, . . . ,p, B, C). The Parameter AdaptationEngine implements an unbiased minimum variance estimator designed by theClearsight team.

The main idea is to use the following version of Bayes' rule${P\text{(}{Pars}\left. X \right)} = {\frac{P\left( {X\left. {Pars} \right){P({Pars})}} \right.}{P(X)}.}$

Pars is a stochastic process whose sample paths record conditionalestimates of the parameters for the filtration generated by the processX. The Parameter Adaptation Engine generates the first and secondmoments of the stochastic process defined by (21).

The process Pars is sampled at regular time intervals T. During eachinterval T the conditional expectation (the first moment) is keptconstant in CFE. This is required to satisfy a stability requirement ofthe overall system (see Kushner [4]).

3.5.1 Observation Model Definition for PAE

In this subsection we derive the observation model for the process Pars.Recall that the conditional first moment of the price process {tildeover (x)}(t), given a sample of the parameters, is given by (2),$\frac{\mathbb{d}{\overset{\sim}{x}(t)}}{\mathbb{d}t} = {{\left( {A_{0} + {\sum\limits_{i = 1}^{m}{A_{i}{u_{i}(t)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{f_{j}(t)}}}} \right){\overset{\sim}{x}(t)}} + {{Bu}(t)} + {{Cf}(t)} + {\phi(t)}}$for an interval tε[t₀,t₁].

The parameters to be estimated are:

-   -   A₀ is an n×n matrix,    -   A_(i), i=1, . . . ,n is an n×n matrix of rank one, and we assume        that the only non-zero value is the ii^(th) entry, denoted A_(i)        _(ii) ,    -   D_(j), j=1, . . . ,p is a diagonal n×n matrix,    -   B is a diagonal n×n matrix, with diagonal elements denoted    -   B_(ii) for i=1, . . . ,n, and    -   C is an n×p matrix.    -   Let η(t) be the observation process        ${\eta(t)} = {\frac{\mathbb{d}{\overset{\sim}{x}(t)}}{\mathbb{d}t} - {{\phi(t)}.}}$

Then from (22)${{\eta(t)} = {{\left( {A_{0} + {\sum\limits_{i = 1}^{m}{A_{i}{u_{i}(t)}}} + {\sum\limits_{j = 1}^{p}{D_{j}{f_{j}(t)}}}} \right){\overset{\sim}{x}(t)}} + {{Bu}(t)} + {{Cf}(t)} + {\overset{\sim}{\theta}(t)}}},$where {tilde over (θ)}(t) is a zero-mean stochastic process withcovariance ${R_{ij}(t)} = \left\{ \begin{matrix}\frac{\quad{{\overset{\sim}{\Theta}}_{ii}(t)}}{\Delta_{data}} & {{{if}\quad i} = j} \\0 & {otherwise}\end{matrix} \right.$that models the observation error.

We write the observation model for the parameters (23) asη(t)={tilde over (P)}(t)p(t)+{tilde over (θ)}(t),where p(t) and {tilde over (P)}(t) are defined below.

We define a column vector p(t) of dimension q×1, where q=n²+2np+2n asfollows: ${p(t)} = \begin{bmatrix}{p_{0}(t)} \\{p_{A}(t)} \\{p_{D}(t)} \\{p_{B}(t)} \\{p_{C}(t)}\end{bmatrix}$where each block (p₀(t), p_(A)(t), p_(D)(t), p_(B)(t), p_(C)(t)) of p(t)is described below. The first block p₀(t) is an n²×1 column vectorconsisting of A₀, ${p_{0}(t)} = \begin{bmatrix}{A_{0_{11}}(t)} \\{A_{0_{12}}(t)} \\\vdots \\\underset{\_}{A_{0_{1n}}(t)} \\{A_{0_{21}}(t)} \\{A_{0_{22}}(t)} \\\vdots \\\underset{\_}{A_{0_{2n}}(t)} \\\vdots \\\overset{\_}{A_{0_{n\quad 1}}(t)} \\{A_{0_{n\quad 2}}(t)} \\\vdots \\{A_{0_{nn}}(t)}\end{bmatrix}$the second block p_(A)(t) is an n×1 is an n column vector consisting ofthe nonzero entries of A_(i), i=1, . . . ,n,${p_{A}(t)} = \begin{bmatrix}{A_{1_{11}}(t)} \\{A_{2_{22}}(t)} \\\vdots \\{A_{n_{nn}}(t)}\end{bmatrix}$the third block p_(D)(t) is an np×1 column vector consisting of nonzero(diagonal) entries of D_(j), j=1, . . . ,p,${p_{D}(t)} = \begin{bmatrix}{D_{1_{11}}(t)} \\{D_{1_{22}}(t)} \\\vdots \\\underset{\_}{D_{1{nn}}(t)} \\{D_{2_{11}}(t)} \\{D_{2_{22}}(t)} \\\vdots \\\underset{\_}{D_{2{nn}}(t)} \\\vdots \\\overset{\_}{D_{p_{11}}(t)} \\{D_{p_{22}}(t)} \\\vdots \\{D_{p_{nn}}(t)}\end{bmatrix}$the fourth block p_(B)(t) is an n×1 column vector consisting of thediagonal elements of B, ${p_{B}(t)} = \begin{bmatrix}{B_{11}(t)} \\{B_{22}(t)} \\\vdots \\{B_{nn}(t)}\end{bmatrix}$and the fifth block p_(C)(t) is an np×1 column vector consisting of theelements of matrix C, ${P_{C}(t)} = {\begin{bmatrix}{C_{11}(t)} \\{C_{12}(t)} \\\vdots \\\underset{\_}{C_{1p}(t)} \\{C_{21}(t)} \\{C_{22}(t)} \\\vdots \\\underset{\_}{C_{2p}(t)} \\\vdots \\\overset{\_}{C_{n\quad 1}(t)} \\{C_{n\quad 2}(t)} \\\vdots \\{C_{np}(t)}\end{bmatrix}.}$

We now provide the structure of {tilde over (P)}(t), a sparse n×qmatrix. We write this matrix in terms of five blocks {tilde over(P)}₀(t), {tilde over (P)}_(A)(t), {tilde over (P)}_(D)(t), {tilde over(P)}_(B)(t), {tilde over (P)}_(C)(t):{tilde over (P)}(t)=[{tilde over (P)} ₀(t)|{tilde over (P)}_(A)(t)|{tilde over (P)} _(D)(t)|{tilde over (P)} _(B)(t)|{tilde over(P)} _(C)(t)].The first block {tilde over (P)}₀(t) is n×n²,${{\overset{\sim}{P}}_{0}(t)} = \begin{bmatrix}{{\overset{\sim}{x}}_{1}(t)} & {{\overset{\sim}{x}}_{2}(t)} & \cdots & {{\overset{\sim}{x}}_{n}(t)} & \quad & \quad & \quad & \quad & \quad & \quad & \quad & \quad & \quad \\\quad & \quad & \quad & \quad & {{\overset{\sim}{x}}_{1}(t)} & {{\overset{\sim}{x}}_{2}(t)} & \cdots & {{\overset{\sim}{x}}_{n}(t)} & \quad & \quad & \quad & \quad & \quad \\\quad & \quad & \quad & \quad & \quad & \quad & \quad & \quad & ⋰ & \quad & \quad & \quad & \quad \\\quad & \quad & \quad & \quad & \quad & \quad & \quad & \quad & \quad & {{\overset{\sim}{x}}_{1}(t)} & {{\overset{\sim}{x}}_{2}(t)} & \cdots & {{\overset{\sim}{x}}_{n}(t)}\end{bmatrix}$the second block {tilde over (P)}_(A)(t) is n×n,${{\overset{\sim}{P}}_{A}(t)} = \begin{bmatrix}{{{\overset{\sim}{x}}_{1}(t)}{u_{1}(t)}} & \quad & \quad & \quad \\\quad & {{{\overset{\sim}{x}}_{2}(t)}{u_{2}(t)}} & \quad & \quad \\\quad & \quad & {\quad ⋰} & \quad \\\quad & \quad & \quad & {{{\overset{\sim}{x}}_{n}(t)}{u_{n}(t)}}\end{bmatrix}$the third block {tilde over (P)}_(D)(t) is n×np,${{\overset{\sim}{P}}_{D}(t)} = \begin{bmatrix}{{{\overset{\sim}{x}}_{1}(t)}{f_{1}(t)}} & \quad & \quad & \quad & {{{\overset{\sim}{x}}_{1}(t)}{f_{2}(t)}} & \quad & \quad & \quad & \quad & {{{\overset{\sim}{x}}_{1}(t)}{f_{p}(t)}} & \quad & \quad & \quad \\\quad & {{{\overset{\sim}{x}}_{2}(t)}{f_{1}(t)}} & \quad & \quad & \quad & {{{\overset{\sim}{x}}_{2}(t)}{f_{2}(t)}} & \quad & \quad & \quad & \quad & {{{\overset{\sim}{x}}_{2}(t)}{f_{p}(t)}} & \quad & \quad \\\quad & \quad & ⋰ & \quad & \quad & \quad & ⋰ & \quad & \cdots & \quad & \quad & ⋰ & \quad \\\quad & \quad & \quad & {{{\overset{\sim}{x}}_{n}(t)}{f_{1}(t)}} & \quad & \quad & \quad & {{{\overset{\sim}{x}}_{n}(t)}{f_{2}(t)}} & \quad & \quad & \quad & \quad & {{{\overset{\sim}{x}}_{n}(t)}{f_{p}(t)}}\end{bmatrix}$the fourth block {tilde over (P)}_(B)(t) is n×n,${{\overset{\sim}{P}}_{B}(t)} = \begin{bmatrix}{u_{1}(t)} & \quad & \quad & \quad \\\quad & {u_{2}(t)} & \quad & \quad \\\quad & \quad & ⋰ & \quad \\\quad & \quad & \quad & {u_{n}(t)}\end{bmatrix}$and the fifth block {tilde over (P)}_(C)(t) is n×np,${{\overset{\sim}{P}}_{C}(t)} = {\begin{bmatrix}{f_{1}(t)} & {f_{2}(t)} & \cdots & {f_{p}(t)} & \quad & \quad & \quad & \quad & \quad & \quad & \quad & \quad & \quad \\\quad & \quad & \quad & \quad & {f_{1}(t)} & {f_{2}(t)} & \cdots & {f_{p}(t)} & \quad & \quad & \quad & \quad & \quad \\\quad & \quad & \quad & \quad & \quad & \quad & \quad & \quad & \cdots & \quad & \quad & \quad & \quad \\\quad & \quad & \quad & \quad & \quad & \quad & \quad & \quad & \quad & {f_{1}(t)} & {f_{2}(t)} & \cdots & {f_{p}(t)}\end{bmatrix}.}$3.5.2 Discrete Dynamics for PAEThe Parameter Adaptation Engine generates an estimate of the parametersp at sampled time intervals kΔ_(data), k=0, 1, 2, . . . . We assume theparameters are time invariant over time-window intervals, therefore theparameter dynamics is given byp(t _(k+1))=p(t _(k))+v(t _(k))where v(t_(k)) is a zero mean Gaussian Brownian q process withcovariance {tilde over (Q)}(t_(k)) that models a process noise.

The positive definite matrix {tilde over (Q)}(t_(k)) is a q×q diagonalmatrix with the diagonal elements given in equations (26) and (27). Thecovariance matrix {tilde over (Q)}(t_(k)) is computed by finding thetrace of the covariance matrix of the stochastic processp(t)−{circumflex over (p)}(t):Tr(E[(p(t)−{circumflex over (p)}(t))(p(t)−{circumflex over(p)}(t))^(T)])=Tr(E[p(t)p ^(T)(t)−p(t){circumflex over (p)}^(T)(t)−{circumflex over (p)}(t)p ^(T)(t)+{circumflex over(p)}(t){circumflex over (p)}(t)^(T)]).To approximate the covariance, we update our estimate of {tilde over(Q)}(t_(k)) every length of the time window T, using the last two storedparameter estimates, {circumflex over (p)}(t−tmod(T)−T) and the previous{circumflex over (p)}(t−tmod(T)−2T) as follows,${{\overset{\sim}{Q}}_{ij}(0)} = \left\{ {{\begin{matrix}{\frac{\left( \alpha_{p} \right)^{2}}{\Delta_{data}}{{Tr}\left( {{\hat{p}(0)}{{\hat{p}}^{T}(0)}} \right)}} & {{{if}\quad i} = j} \\{0} & {otherwise}\end{matrix}\quad{for}\quad i},{j = 1},\ldots\quad,q} \right.$and when t mod(T)=0,${{\overset{\sim}{Q}}_{ij}(t)} = \left\{ \begin{matrix}\begin{matrix}{\frac{\quad\left( \quad\alpha_{\quad p} \right)^{2}}{\quad\Delta_{\quad{data}}}{{{\underset{k\quad = \quad 1}{\sum\limits^{q}}\left( \quad{{\quad\hat{p}}_{k}\left( {t\quad - \quad T} \right)} \right)^{2}} - {2{\quad\hat{p}}_{k}\left( {t - T} \right){\quad\hat{p}}_{k}\left( {t - {2T}} \right)} +}}} \\{\left( \quad{{\hat{p}}_{k}\left( {t\quad - \quad T} \right)} \right)^{2}}\end{matrix} & {{{if}\quad i} = j} \\0 & {otherwise}\end{matrix} \right.$for i, j=1, . . . ,q, and when t mod(T)≠0, let {tilde over(Q)}_(ij)(t)={tilde over (Q)}_(ij)(t−tmod(T)). We let α_(p)=0.05initially. Notice that while {tilde over (Q)}(t) is a q×q matrix, it isdiagonal and all the diagonal elements have the same value, so it isonly necessary to store a single value to represent {tilde over (Q)}(t).3.5.3 Estimation Method for {tilde over (Q)}(t) in PAEThe stochastic equation for parameters isdp(t)=0+dv(t)where dv(t) is a zero mean Gaussian Brownian process with covariance{tilde over (Q)}(t)dt, and {tilde over (Q)}(t) is positive definite.

In the forecast engine, we use discrete Kalman filter to updateparameters p(t). Given the k^(th) estimation of parameters, {tilde over(p)}_(k) and its covariance Σ_(k|k) and given (k+1)^(th) observation{tilde over (R)} and given {tilde over (p)}, we update Σ to getΣ_(k+1|k+1)=(Σ_(k|k) +{tilde over (Q)})−(Σ_(k|k) +{tilde over(Q)}){tilde over (p)} ^(T)(Σ_(k|k) +{tilde over (Q)}){tilde over (p)}^(T) +{tilde over (R)})⁻¹ {tilde over (p)}(Σ_(k|k) +{tilde over (Q)})where {tilde over (R)} and {tilde over (Q)} are diagonal. If k→∞, thenΣ_(k)→stable states, which are denoted by Σ_(∞). Therefore as k→∞, thenΣ_(k|k)→Σ_(∞), Σ_(k+1|k+1)→Σ_(∞), and {tilde over (Q)}→{tilde over(Q)}_(∞). Restating equation (28) using Σ_(∞) and {tilde over (Q)}_(∞)we getΣ_(∞)=(Σ_(∞) +{tilde over (Q)} _(∞))−(Σ_(∞) +{tilde over (Q)}_(∞)){tilde over (p)} ^(T)({tilde over (p)}(Σ_(∞) +{tilde over (Q)}_(∞)){tilde over (p)} ^(T) +{tilde over (R)})⁻¹ {tilde over (p)}(Σ_(∞)+{tilde over (Q)} _(∞))

We assume that the parameters are independent in infinity (i.e. Σ_(∞) isdiagonal), and that the main contribution of {tilde over (p)} to Σ_(∞)(i, i) is the i^(th) column of {tilde over (p)}, and that other columnscan be ignored. Let $\sum\limits_{i}^{\infty}\quad$denote Σ_(∞)(i, i), {tilde over (Q)}_(i) ^(∞) denote {tilde over(Q)}_(∞)(i, i), {tilde over (p)}_(i) denote the i^(th) column of {tildeover (p)}. Also assume that for the scaler r,${\overset{\sim}{Q}}_{i}^{\infty} = \left\{ \begin{matrix}r & \begin{matrix}{{{if}\quad p_{\quad i}\quad{is}\quad{the}\quad{parameter}\quad{related}\quad{to}\quad u\quad(t)\quad{or}}\quad} \\{{\quad}{x\quad(t)\quad{or}\quad{f(t)}\quad{terms}}}\end{matrix} \\r^{2} & \begin{matrix}{{if}\quad p_{\quad i}\quad{is}\quad{the}\quad{parameter}\quad{associated}\quad{with}} \\{{x(t)}{v(t)}\quad{or}\quad{x(t)}{f(t)}\quad{terms}}\end{matrix}\end{matrix} \right.$Then we can restate equation (28) again as $\begin{matrix}{\sum\limits_{i}^{\infty}{= {\left( {\sum\limits_{i}^{\infty}{+ {\overset{\sim}{Q}}_{i}^{\infty}}} \right) - {\left( {\sum\limits_{i}^{\infty}{+ {\overset{\sim}{Q}}_{i}^{\infty}}} \right){{\overset{\sim}{p}}_{i}^{T}\left( {{{{\overset{\sim}{p}}_{i}\left( {\sum\limits_{i}^{\infty}{+ {\overset{\sim}{Q}}_{i}^{\infty}}} \right)}{\overset{\sim}{p}}_{i}^{T}} + \overset{\sim}{R}} \right)}^{- 1}}}}} \\{{{\overset{\sim}{p}}_{i}\left( {\sum\limits_{i}^{\infty}{+ {\overset{\sim}{Q}}_{i}^{\infty}}} \right)}.}\end{matrix}$

Let n denote the number of correlated stocks. The structure of {tildeover (p)}_(i) is n×1, and only one entry is non-zero, which we denote byj. Then $\begin{matrix}{{{{\overset{\sim}{p}}_{i}^{T}\left( {{{{\overset{\sim}{p}}_{i}\left( {\sum\limits_{i}^{\infty}{+ {\overset{\sim}{Q}}_{i}^{\infty}}} \right)}{\overset{\sim}{p}}_{i}^{T}} + \overset{\sim}{R}} \right)}^{- 1}{\overset{\sim}{p}}_{i}} = {{{{\overset{\sim}{p}}_{i}(j)}\text{(}{{\overset{\sim}{p}}_{i}(j)}\left( {\sum\limits_{i}^{\infty}{+ {\overset{\sim}{Q}}_{i}^{\infty}}} \right){{\overset{\sim}{p}}_{i}(j)}} +}} \\{\left. {\overset{\sim}{R}\left( {j,j} \right)} \right)^{- 1}{{\overset{\sim}{p}}_{i}(j)}} \\{= {{\left\lbrack {{\overset{\sim}{p}}_{i}(j)} \right\rbrack^{2}\text{(}{{\overset{\sim}{p}}_{i}(j)}\left( {\sum\limits_{i}^{\infty}{+ {\overset{\sim}{Q}}_{i}^{\infty}}} \right){{\overset{\sim}{p}}_{i}(j)}} +}} \\\left. {\overset{\sim}{R}\left( {j,j} \right)} \right)^{- 1}\end{matrix}$

Let α_(i)=({tilde over (p)}_(i)(j))², where j is index of the onlynon-zero entry of {tilde over (p)}_(i), and noting that {tilde over (R)}is an n×n diagonal matrix, then $\begin{matrix}{\sum\limits_{i}^{\infty}{= {\left( {\sum\limits_{i}^{\infty}{+ {\overset{\sim}{Q}}_{i}^{\infty}}} \right) - {\left( {\sum\limits_{i}^{\infty}{+ {\overset{\sim}{Q}}_{i}^{\infty}}} \right){\alpha_{i}\left( {{{\alpha_{i}\left( {\sum\limits_{i}^{\infty}{+ {\overset{\sim}{Q}}_{i}^{\infty}}} \right)}{\overset{\sim}{p}}_{i}^{T}} +} \right.}}}}} \\{\left. {\overset{\sim}{R}\left( {j,j} \right)} \right)^{- 1}\left( {\sum\limits_{i}^{\infty}{+ {\overset{\sim}{Q}}_{i}^{\infty}}} \right)}\end{matrix}$ $\begin{matrix}{{{\alpha_{i}\left( {\sum\limits_{i}^{\infty}{+ {\overset{\sim}{Q}}_{i}^{\infty}}} \right)}{\sum\limits_{i}^{\infty}{{+ {\overset{\sim}{R}\left( {j,j} \right)}}\sum\limits_{i}^{\infty}}}} = {{\alpha_{i}\left( {\sum\limits_{i}^{\infty}{+ {\overset{\sim}{Q}}_{i}^{\infty}}} \right)}^{2} + {\left( {\sum\limits_{i}^{\infty}{+ {\overset{\sim}{Q}}_{i}^{\infty}}} \right){\overset{\sim}{R}\left( {j,j} \right)}} -}} \\{{\alpha_{i}\left( {\sum\limits_{i}^{\infty}{+ {\overset{\sim}{Q}}_{i}^{\infty}}} \right)}^{2}}\end{matrix}$${{\alpha_{i}\left( \sum\limits_{i}^{\infty} \right)}^{2} + {\alpha_{i}{\overset{\sim}{Q}}_{i}^{\infty}{\sum\limits_{i}^{\infty}{{- {\overset{\sim}{Q}}_{i}^{\infty}}{\overset{\sim}{R}\left( {j,j} \right)}}}}} = 0$which is solved for $\sum\limits_{i}^{\infty}$$\sum\limits_{i}^{\infty}{= {\frac{{{- \alpha_{i}}{\overset{\sim}{Q}}_{i}^{\infty}} \pm \sqrt{\left( {\alpha_{i}{\overset{\sim}{Q}}_{i}^{\infty}} \right)^{2} + {4{\overset{\sim}{Q}}_{i}^{\infty}{\overset{\sim}{R}\left( {j,j} \right)}}}}{2\quad\alpha_{i}}.}}$Because Σ_(i) ^(∞)≧0 we use only the “+” which gives us$\sum\limits_{i}^{\infty}{= {\frac{{{- \alpha_{i}}{\overset{\sim}{Q}}_{i}^{\infty}} + \sqrt{\left( {\alpha_{i}{\overset{\sim}{Q}}_{i}^{\infty}} \right)^{2} + {4{\overset{\sim}{Q}}_{i}^{\infty}{\overset{\sim}{R}\left( {j,j} \right)}}}}{2\quad\alpha_{i}}.}}$where j corresponds to the one and only non-zero entry of {tilde over(p)}_(i).

In the algorithm, {tilde over (Q)}_(i) ^(∞) will be estimated by$\sum\limits_{i}^{\infty},$i.e. ${\overset{\sim}{Q}}_{i}^{\infty} = \begin{bmatrix}\sum\limits_{1}^{\infty} & 0 & \cdots & 0 \\0 & \sum\limits_{2}^{\infty} & \cdots & 0 \\\vdots & \vdots & ⋰ & \vdots \\0 & 0 & \cdots & \sum\limits_{q}^{\infty}\end{bmatrix}$where q is the number of parameters; α_(i) and {tilde over (Q)}_(i) ^(∞)are as we defined above; and R and {tilde over (p)}_(i) are givenfunctions of time.3.5.4 Aggregated Discrete Observation Model for PAETo ensure sufficient statistics well-posediness, we need to construct anobservation sample out of the observations generated during the intervalΔT. The number of needed observations in the observation sample is afunction of the number of parameters to be identified, q.

The discrete observation model is given byπ(t _(k))={tilde over (P)}(t _(k))p(t _(k))+{tilde over (θ)}(t _(k))where {tilde over (θ)}(t_(k)) is a zero mean discrete Gaussianstochastic measurement noise with covariance {tilde over (R)}(t_(k)) andπ(t_(k)) and {tilde over (P)}(t_(k)) are defined later. The covariancematrix {tilde over (R)}(t_(k)) is an$\left( {n\frac{\Delta\quad T}{\Delta_{data}}} \right) \times \left( {n\frac{\Delta\quad T}{\Delta_{data}}} \right)$diagonal matrix given by${\overset{\sim}{R}\left( t_{k} \right)} = \begin{bmatrix}{R\left( t_{k} \right)} & \quad & \quad & \quad \\\quad & {R\left( {t_{k} - {\Delta\quad}_{data}} \right)} & \quad & \quad \\\quad & \quad & ⋰ & \quad \\\quad & \quad & \quad & {R\left( {t_{k} - {\Delta\quad T} + {\Delta\quad}_{data}} \right)}\end{bmatrix}$where ${R_{ij}\left( t_{k} \right)} = \left\{ \begin{matrix}\frac{{\overset{\sim}{\Theta}}_{ii}\left( t_{k} \right)}{\Delta_{data}} & {{{if}\quad i} = j} \\0 & {otherwise}\end{matrix} \right.$for i, j=1, . . . ,n.

Now we define π(t_(k)) and {tilde over (P)}(t_(k)). The column vectorπ(t_(k)) is${{n\left( \frac{\Delta\quad T}{\Delta_{data}} \right)} \times 1},$${\Pi\left( t_{k} \right)} = \begin{bmatrix}{\eta\left( t_{k} \right)} \\{\eta\left( {t_{k} - \Delta_{data}} \right)} \\{\eta\left( {t_{k} - {2\Delta_{data}}} \right)} \\\vdots \\{\eta\left( {t_{k} - {\Delta\quad T} + \Delta_{data}} \right)}\end{bmatrix}$and each η(t) block is n×1 with${\eta(t)} = {\frac{\mathbb{d}{\overset{\sim}{x}(t)}}{\mathbb{d}t} - {{\phi(t)}.}}$The matrix${{\overset{\sim}{\overset{\sim}{P}}\left( t_{k} \right)}{\quad\quad}{is}\quad{\left( {n\frac{\Delta\quad T}{\Delta_{data}}} \right) \times q}},$${\overset{\sim}{\overset{\sim}{P}}\left( t_{k} \right)} = \begin{bmatrix}{\overset{\sim}{P}\left( t_{k} \right)} \\{\overset{\sim}{P}\left( {t_{k} - \Delta_{data}} \right)} \\{\overset{\sim}{P}\left( {t_{k} - {2\Delta_{data}}} \right)} \\\vdots \\{\overset{\sim}{P}\left( {t_{k} - {\Delta\quad T} + \Delta_{data}} \right)}\end{bmatrix}$and each {tilde over (P)}(t) block is n×q and given in (24).3.5.5 Discrete FilterWe now describe our implementation of the discrete filter. Let{circumflex over (p)}(t_(k+1)|t_(k)) denote an estimate (conditionalmean) of p(t) at time sample t_(k+1) given observations up to timet_(k), and let {circumflex over (p)}(t_(k+1)|t_(k+1)) denote an estimatef p(t) at time sample t_(k+1) given an observation at time t_(k+1). Letalso Σ(t_(k+1)|t_(k)) denote the covariance matrix of p(t) at timesample t_(k+1).

Let K_(D)(t_(k+1)) be a$q \times \left( {n\frac{{\Delta\quad T}\quad}{\Delta_{data}}} \right)$matrix representing the discrete gain at time sample t_(k+1). It isgiven by (see Jazwinski [3]),${K_{D}\left( t_{k + 1} \right)} = {\sum{\left( {t_{k + 1}\text{❘}t_{k}} \right)\left( {\overset{\sim}{\overset{\sim}{P}}\left( t_{k + 1} \right)} \right)^{T}\left( {{{\overset{\sim}{\overset{\sim}{P}}\left( t_{k + 1} \right)}{\sum{\left( {t_{k + 1}\text{❘}t_{k}} \right)\left( {\overset{\sim}{\overset{\sim}{P}}\left( t_{k + 1} \right)} \right)^{T}}}} + {\overset{\sim}{R}\left( t_{k + 1} \right)}} \right)^{- 1}}}$

The propagation of the conditional mean {circumflex over(p)}(t_(k+1)|t_(k+1)) and the covariance matrix Σ(t_(k+1)|t_(k+1)) afteran observation at time t_(k+1) is made is given by the followingequationsΣ(t _(k+1) |t _(k))=Σ(t _(k) |t _(k))+{tilde over (Q)}(t _(k+1))Σ(t _(k+1) |t _(k+1))=Σ(t _(k+1) |t _(k))−K _(D)(t _(k+1)){tilde over({tilde over (P)})}(t _(k+1))Σ(t _(k+1) |t _(k)){circumflex over (p)}(t _(k+1) |t _(k))=I{circumflex over (p)}(t _(k) |t_(k)){circumflex over (p)}(t _(k+1) |t _(k+1))={circumflex over (p)}(t _(k+1)|t _(k))+K _(D)(t _(k+1))(π(t _(k+1))−{tilde over ({tilde over (P)})}(t_(k+1)){circumflex over (p)}(t _(k+1) |t _(k))).

Equation (34) is called a prediction equation because it gives a way topropagate {circumflex over (p)}(t_(k)|t_(k)) without an observation.Equation (35) is called a correction equations because it corrects{circumflex over (p)}(t_(k+1)|t_(k)) based on an observation made attime t_(k+1). The term (π(t_(k+1))−{tilde over ({tilde over(P)})}(t_(k+1)){circumflex over (p)}(t_(k+1)|t_(k))), called aninnovation process, gives a difference between an observation made attime t_(k+1), π(t_(k+1)), and a “predicted observation” {tilde over({tilde over (P)})}(t_(k+1)){circumflex over (p)}(t_(k+1)|t_(k)).

To summarize, we can give the steps needed in the flowchart of PAE.

Step 0. Initialize {circumflex over (p)}(0|0) and Σ(0|0). Set currenttime to t_(k)←t₀.

Step 1. Set current time to t_(k)←t_(k)+ΔT. Get information needed fromthe shared memory system: {tilde over (x)}^(N)(t), η(t),tε[t_(k)−ΔT+Δ_(data),t_(k)]; ũ^(NN)(t_(k)−Δ^(T)), f^(data)(t_(k)−ΔT).

Step 2. Construct π(t_(k)), {tilde over ({tilde over (P)})}(t_(k)),{tilde over (R)}(t_(k)), and {tilde over (Q)}(t_(k))

Step 3 Calculate.Σ(t _(k) |t _(k) −ΔT)←Σ(t _(k) −ΔT|t _(k) −ΔT)+{tilde over (Q)}(t _(k))$\left. {\sum\left( {{t_{k}\text{❘}t_{k}} - {\Delta\quad T}} \right)}\leftarrow{\frac{1}{2}\left( {{\sum\left( {{t_{k}\text{❘}t_{k}} - {\Delta\quad T}} \right)} + {\sum\left( {{t_{k}\text{❘}t_{k}} - {\Delta\quad T}} \right)^{T}}} \right)} \right.$ K _(D)(t _(k))←Σ(t _(k) |t _(k) −ΔT)({tilde over ({tilde over (P)})}(t_(k)))^(T)({tilde over ({tilde over (P)})}(t _(k))Σ(t _(k) |t _(k)−ΔT)({tilde over ({tilde over (P)})}(t _(k)))^(T) +{tilde over (R)}(t_(k)))⁻¹{circumflex over (p)}(t _(k) |t _(k))←{circumflex over (p)}(t _(k) −ΔT|t_(k) −ΔT)+K _(D)(t _(k))(π(t _(k))−{tilde over ({tilde over (P)})}(t_(k)){circumflex over (p)}(t _(k) −ΔT|t _(k) −ΔT))Σ(t _(k) |t _(k))←(I−K _(D)(t _(k)){tilde over ({tilde over (P)})}(t_(k)))Σ(t _(k) |t _(k) −ΔT)Σ(t _(k))←(Σ(t _(k))+(Σ(t _(k)))^(T))/2Step 4. Go to Step 1.3.5.6 Continuous Measurement Filter for PAEThis is cut-and-paste from the previous version of PAE, where we did nothave enough data to estimate the parameters.

To conclude, given continuous trajectories x(t), u(t), f(t), and φ(t),the continuous measurement process for p(t) is written asd{tilde over (x)}(t)−φ(t)dt={tilde over (P)}(t)p(t)dt+dθ(t)where dθ(t) is a zero mean Gaussian stochastic measurement noise withcovariance R(t)dt. The noise θ(t) is due to the noise in measuringprice. The covariance matrix R(t) is estimated by the risk {tilde over(Θ)}(t) where ${R_{ij}(t)} = \left\{ \begin{matrix}\frac{{\overset{\sim}{\Theta}}_{ii}(t)}{\Delta_{data}} & {{{if}\quad i} = j} \\0 & {otherwise}\end{matrix} \right.$for i, j=1, . . . ,n and Δ_(data) is the time step in the ContinuousForecast Engine (possibly one second).

Assuming the parameters are constant over short intervals, we specifythe dynamics of the parameter system by the following stochasticdifferential equationdp(t)=0+dv(t)where the 0_(q×1) column vector indicates that {circumflex over (p)}(t)is constant over the interval of interest, and dv(t) is a zero meanGaussian Brownian q process with covariance {tilde over (Q)}(t)dt, where{tilde over (Q)}(t) is positive definite. The noise v(t) is due to thenoise in the parameters.The covariance matrix {tilde over (Q)}(t) is estimated by taking theTr(E[(p(t)−{circumflex over (p)}(t))(p(t)−{circumflex over(p)}(t))^(T)])=Tr(E[p(t)p ^(T)(t)−p(t){circumflex over (p)}^(T)(t)−{circumflex over (p)}(t)p ^(T)(t)+{circumflex over(p)}(t){circumflex over (p)}(t)^(T)]).To approximate the covariance, we update our estimate of {tilde over(Q)}(t) every length of the time window T, using the last two storedparameter estimates, {circumflex over (p)}(t−t mod(T)−T) and theprevious {circumflex over (p)}(t−t mod(T)−2T) as follows,${\overset{\sim}{Q}}_{ij} = \left\{ {{\begin{matrix}{\frac{\left( \alpha_{p} \right)^{2}}{\Delta_{data}}{{Tr}\left( {{\hat{p}(0)}{{\hat{p}}^{T}(0)}} \right)}} & {{{if}\quad i} = j} \\0 & {otherwise}\end{matrix}\quad{for}\quad i},{j = 1},\ldots\quad,q} \right.$and when t mod(T)=0,${{\overset{\sim}{Q}}_{ij}(t)} = \left\{ \begin{matrix}{\frac{\left( \alpha_{p} \right)^{2}}{\Delta_{data}}{{{\sum\limits_{k = 1}^{q}\left( {{\hat{p}}_{k}\left( {t - T} \right)} \right)^{2}} - {2{{\hat{p}}_{k}\left( {t - T} \right)}{{\hat{p}}_{k}\left( {t - {2T}} \right)}} + \left( {{\hat{p}}_{k}\left( {t - {2T}} \right)} \right)^{2}}}} & {{{if}\quad i} = j} \\0 & {otherwise}\end{matrix} \right.$for i, j=1, . . . ,q, and when t mod(T)≠0, let {tilde over(Q)}_(ij)(t)={tilde over (Q)}_(ij)(t−t mod(T)). We let α_(p)=0.05initially. Notice that while {tilde over (Q)}(t) is a q×q matrix, it isdiagonal and all the diagonal elements are the same value, so it is onlynecessary to store a single value to represent {tilde over (Q)}(t).

We now apply the continuous measurement filter as described in HybridAsynchronous Filter. We propagate the conditional mean {circumflex over(p)}(τ|t_(k)) and covariance matrix Σ(τ|t_(k)) according to thefollowing equations,$\frac{\mathbb{d}{\hat{p}\left( {\tau\text{❘}t_{k}} \right)}}{\mathbb{d}\tau} = {0 + {{K_{c}\left( {\tau\text{❘}t_{k}} \right)}\left( {\frac{\mathbb{d}{\hat{x}(\tau)}}{\mathbb{d}\tau} - {\phi(\tau)} - {{\overset{\sim}{P}(\tau)}{\hat{p}\left( {\tau\text{❘}t_{k}} \right)}}} \right)}}$with initial conditions Σ(t_(k)|t_(k)), and where K_(c)(τ|t_(k)), a q×nmatrix, is the continuous gain given byK _(c)(τ|t _(k))=Σ(τ|t _(k))({tilde over (P)}(τ))^(T)(R(τ))⁻¹and$\frac{\mathbb{d}{\Sigma\left( {\tau\text{❘}t_{k}} \right)}}{\mathbb{d}\tau} = {{\overset{\sim}{Q}(\tau)} - {{\Sigma\left( {\tau\text{❘}t_{k}} \right)}\left( {\overset{\sim}{P}(\tau)} \right)^{T}\left( {R(\tau)} \right)^{- 1}{\overset{\sim}{P}(\tau)}{\Sigma\left( {\tau\text{❘}t_{k}} \right)}}}$with initial condition Σ(t_(k)|t_(k)). Note Σ(τ|t_(k)) is a q×qsymmetric matrix. In the implementation of PAE, the observations d{tildeover (x)}(τ)/dr, φ(τ), {tilde over (P)}(τ), and R(τ) are updated everyΔ_(data) and {tilde over (Q)}(τ) is updated every T.For initialization purposes, an initial {circumflex over(p)}(0)={circumflex over (p)}₀ is estimated from historical data using amin least squares approach.3.6 Learning EngineThe concept of the repair strategy is to first use historical data toestimate the parameters of the model. This is called the training mode.Once we have initial estimates for the parameters, we are in thesimulated real-time mode. In this mode, we can use the dynamical model(??) with the estimated parameters to solve for the price and risktrajectories. The time window is advanced and the data is updated. Thenthe parameters are estimated again. As the time window slides, therepair strategy continuously solves for the price and risk trajectorieswhile updating the parameters in real-time, see section 3.4.3.7 Lowpass FilterThe Lowpass Filter is used to filter the predicted price {circumflexover (x)}^(predict)(t) provided by the Forecast Engine to producex^(out)(t), the price provided to the user. It does this using a Laplacetransform of the signals: {circumflex over (X)} ^(out)(t) is the Laplacetransform of {circumflex over (x)}_(out)(t).$\frac{{output}\quad{signal}}{{input}\quad{signal}} = {\frac{{\hat{x}}_{\mathcal{L}}^{out}(t)}{{\hat{x}}_{\mathcal{L}}^{predict}(t)} = {\frac{2\pi}{T_{LF}} \cdot \frac{1}{t + \frac{2\pi}{T_{LF}}}}}$

T_(LF) is given; a large value of T_(LF) filters high frequency signals.$= {{{t \cdot {{\hat{x}}^{out}(t)}} + {{{\hat{x}}^{out}(t)} \cdot \frac{2\pi}{T_{LF}} \cdot}} = {\frac{2\pi}{T_{LF}}{{\hat{x}}_{L}^{predict}(t)}}}$Using known properties of Laplace transforms, use inverse Laplacetransform

⁻¹, where:

⁻¹(t·x ^(out)(t)={dot over (x)} ^(out)(t)

⁻¹(x ^(out)(t))=x ^(out)(t)

⁻({circumflex over (x)} ^(predict)(t))={circumflex over (x)}^(predict)(t)we have:${{\overset{.}{x}}^{out}(t)} = {\frac{2\pi}{T_{LF}}\left( {{{\hat{x}}^{predict}(t)} - {x^{out}(t)}} \right)}$For each stock, given {circumflex over (x)}^(predict)(t_(c)+ΔT) andx^(out)(t_(c)+ΔT−Δ_(c)), which is from the previous filtered forecast,we solve for x^(out)(t_(c)+ΔT). For tε[t_(c)+ΔT−Δ_(c), t_(c)+ΔT] let{circumflex over (x)}^(predict)(t)=constant={circumflex over(x)}^(predict)(t_(c)+ΔT) We solve the following differential equations$\frac{\mathbb{d}{x^{out}(t)}}{\mathbb{d}t} = {\frac{2\pi}{T_{LF}}\left( {{{\hat{x}}^{predict}\left( {t_{c} + {\Delta\quad T}} \right)} - {x^{out}(t)}} \right)}$

-   -   with the initial condition x^(out)(t_(c)+ΔT−Δ_(c))

If x is a scalar, and x(t)=αx(t)+b for tε[t₀,t₁], thenx(t) = 𝕖^(a(t − t₀))x(t) + ∫_(t₀)^(t)𝕖^(a(t − t₀))b  𝕕t${{\overset{.}{x}}^{out}(t)} = {\frac{2\pi}{T_{LF}}\left( {{x^{out}(t)} + {\frac{2\pi}{T_{LF}}{{\hat{x}}^{predict}\left( {t_{c} + {\Delta\quad T}} \right)}}} \right.}$

-   -   with tε[t_(c)+ΔT−Δ_(c), t_(c)+ΔT]        Let t₀=t_(c)+ΔT−Δ_(c), then $\begin{matrix}        {{x^{out}(t)} = {{{\mathbb{e}}^{{- \frac{2\pi}{T_{LF}}}{({t - t_{0}})}}{x^{out}\left( t_{0} \right)}} + {\int_{t_{0}}^{t}{{\mathbb{e}}^{{- \frac{2\pi}{T_{LF}}}{({t - t_{0}})}}\frac{2\pi}{T_{LF}}{{\hat{x}}^{predict}\left( {t_{c} + {\Delta\quad T}} \right)}{\mathbb{d}t}}}}} \\        {= {{{\mathbb{e}}^{{- \frac{2\pi}{T_{LF}}}{({t - t_{0}})}}{x^{out}\left( t_{0} \right)}} - \left( {{\mathbb{e}}^{{- \frac{2\pi}{T_{LF}}}{({t - t_{0}})}}\frac{2\pi}{T_{LF}}{{\hat{x}}^{predict}\left( {t_{c} + {\Delta\quad T}} \right)}} \right._{t_{0}}^{t}}} \\        {= {{{\mathbb{e}}^{{- \frac{2\pi}{T_{LF}}}{({t - t_{0}})}}{x^{out}\left( t_{0} \right)}} - {\left\lbrack {{\mathbb{e}}^{{- \frac{2\pi}{T_{LF}}}{({t - t_{0}})}} - 1} \right\rbrack{{\hat{x}}^{predict}\left( {t_{c} + {\Delta\quad T}} \right)}}}} \\        {= {{{\mathbb{e}}^{{- \frac{2\pi}{T_{LF}}}\Delta_{data}}{x^{out}\left( t_{0} \right)}} - {{{\hat{x}}^{predict}\left( {t_{c} + {\Delta\quad T}} \right)}\left\lbrack {{\mathbb{e}}^{{- \frac{2\pi}{T_{LF}}}\Delta_{data}} - 1} \right\rbrack}}}        \end{matrix}$        3.8 Implementation        An overview of the modules in the repair system simulated        real-time architecture is included below. In this section and in        the flowcharts, we assume that computation is instantaneous, so        the clock is not advanced during computation.        3.8.1 Asynchronous Filter Bank (AFB)    -   Reads asynchronous data from the tape, filters it, then sends        filtered data at every Δ_(data) to the database.    -   Input: From the data tape when data is available at time        t_(data);        x^(ask)(t_(data)),x^(bid)(t_(data)),x^(sell)(t_(data)),u^(data)(t_(data)),f^(data)(t_(data))    -   Output: To the database for t every Δ_(data);        x^(ask)(t),x^(bid)(t),x^(sell)(t),u^(data)(t),f^(data)(t)        3.8.2 Parameter Adaptation Engine (PAE)    -   Computes the {circumflex over (p)}(t_(c)) parameters including        {A₀, A_(i), i=1, . . . ,n, D_(j), j=1, . . . ,p, B, C}.    -   Input: From the database for nominal trajectories at time        l=t_(c)−T;        {tilde over (x)}^(N)(l),{tilde over        (Θ)}^(N)(l),ũ^(N)(l),f^(N)(l),        and for time t_(c);        $\left. \frac{\mathbb{d}{{\overset{\sim}{x}}^{N}(t)}}{\mathbb{d}t} \right|_{t_{c}},{\phi^{N}\left( t_{c} \right)}$    -   Output: To the database when t_(c) mod T=0; {circumflex over        (p)}(t_(c)),        or if {circumflex over (p)}(ξ) was updated for        t_(c)−Δ_(data)<ξ≦t_(c), and ξ mod T=0, then store {circumflex        over (p)}(ξ)        3.8.3 Continuous Forecast Engine (CFE)        Computes nominal and repair trajectories. Consists of the        following elements: Initialization CFE Routine, Coefficient        Generator and Synchronization module, Repair Generator and        Nominal Update Generator.        CFE: Initialization CFE Routine    -   Computes an initial estimate of p, and the following data:        {tilde over (x)}^(IC)(t_(c)),{tilde over (x)}^(N)(t_(c)),{tilde        over (Θ)}^(IC)(t_(c)),{tilde over        (Θ)}^(N)(t_(c)),Q^(N)(t_(c)),ũ^(NN)(t_(c)),f^(N)(t_(c)),        φ^(N)(t_(c)),g^(N)(t_(c)),ξ^(N)(t_(c)),W^(N)(t_(c))        CFE: Nominal Update Generator    -   Computes a forecast of the price and the risk value at t_(c)+ΔT.    -   Input:        {tilde over (x)}^(IC)(t_(c)),{tilde over        (Θ)}^(IC)(t_(c)),Ã^(NN)(t_(c)),{tilde over        (E)}^(NN)(t_(c)),Q^(N)(t_(c))    -   Output: To user {tilde over (x)}_(i) ^(N)(t_(c)+ΔT), and        √{square root over ({tilde over (Θ)}_(ii) ^(N)(t_(c)+ΔT))} for        each stock i=1, . . . ,n and sends to the database, {tilde over        (x)}^(N)(τ), ({tilde over (Θ)}^(N)(τ), d{tilde over        (x)}^(N)/dt|_(τ) for t_(c)≦τ≦t_(c)+ΔT        CFE: Coefficient Generator and Synchronization (CG&S)        Computes the coefficients needed for the Repair Generator and        the Nominal Update Generator, and also identifies whether the        parameters have changed and sets t₁,        $t_{1} = \left\{ \begin{matrix}        {{t_{c} - T + {\Delta\quad T\quad{if}\quad t_{c}}} = {0{mod}\quad T}} \\        {{t_{c}\quad{if}\quad t_{c}} \neq {0{mod}\quad T}}        \end{matrix} \right.$        where    -   Input:        {circumflex over (p)}(t_(c)),Q^(N)(t_(c)),x^(sell)(t_(c)),        {tilde over (x)}^(N)(t),{tilde over        (Θ)}^(N)(t),ũ^(N)(t),f^(N)(t),g^(N)(t),φ^(N)(t),ξ^(N)(t),W^(N)(t)        for t=t₁, t₁+Δ_(data), . . . ,t_(c)        x^(ask)(t),x^(bid)(t),t=t _(c) −ΔT+Δ        _(data),t_(c)−ΔT+2Δ_(data),t_(c)    -   Output:        Coefficients output to CFE for use in the Repair Generator and        in the Nominal Update Generator include:        Ã(t),{tilde over (B)}(t),{tilde over (C)}(t),{tilde over        (D)}(t),{tilde over (V)}(t),γ_(y)(t),γ_(Ω)(t),γ_(v)(t),for        t=t₁,t₁+Δ_(data), . . . ,t_(c)+ΔT        x^(sell)(t_(c)+ΔT),Q^(N)(t_(c)+ΔT)        Nominal trajectories stored in the database include:        ũ^(N)(t),f^(N)(t),        φ^(N)(t),g^(N)(t),ξ^(N)(t),W^(N)(t),x^(ask)(t),x^(bid)(t) for        t=t_(c)+Δ_(data),t_(c)+2Δ_(data), . . . ,t_(c)+ΔT        CFE: Repair Generator        Uses the coefficients prepared by CG&S to solve the repair        problem (using RSolver or other solver) for the repair variables        over [t₁,t_(c)], which is considered long repair if parameters        have changed and t₁=t_(c)−T+ΔT, or short repair if parameters        have not changed and t₁=t_(c). Also computes observations η        needed for PAE.    -   Input:        Ã(t),{tilde over (B)}(t),{tilde over (C)}(t),{tilde over        (D)}(t),{tilde over (E)}(t),{tilde over        (V)}(t),γ_(y)(t),γ_(Ω)(t),γ_(v)(t),{tilde over        (x)}^(N)(t),{tilde over (Θ)}^(N)(t),ũ^(N)(t) for        t=t₁,t₁+Δ_(data), . . . ,t_(c)+ΔT        {tilde over (x)}^(N)(t),{tilde over        (Θ)}^(N)(t),ũ^(N)(t),f^(N)(t) for        t=t_(c)−ΔT+Δ_(data),t_(c)−ΔT+2Δ_(data), . . . ,t_(c)    -   Output:        To CFE: {tilde over (x)}^(NN)(t_(c)), {tilde over        (Θ)}^(NN)(t_(c))        To Shared Memory System:        R(t),η(t) for t=t_(c)−ΔT+Δ_(data),t_(c)−ΔT+2Δ_(data), . . .        ,t_(c), and ũ^(NN)(t_(c)),f^(N)(t_(c))

1. A method for generating a real time state forecast signal for afinancial instrument, the method comprising: receiving information abouta market instrument; transforming the received market-instrumentinformation into a synchronous signal; estimating uncertainty in themarket-instrument information; estimating parameters of a modelcharacterizing the instrument dynamics; and determining a nominal stateforecast signal for the financial instrument.
 2. The method of claim 1wherein financial instruments include: currency; stocks; bonds; andfutures
 3. The method of claim 1 wherein a state forecast signal mayinclude one or more of: a price signal; a risk signal; a volatilitysignal; a marginal volume signal; a price-rate signal; a risk-ratesignal; a volatility-rate signal; and a marginal-volume-rate signal.